| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <template>
- <view
- class="gui-right-menus"
- :style="styles">
- <view
- v-if="show"
- ref="guirightmenu"
- class="gui-rt-menus-animate"
- :class="[outting ? 'slideOutRight' : 'slideInRight']">
- <slot name="menus-more"></slot>
- </view>
- <view
- hover-class="gui-tap"
- @tap.stop="toggle">
- <slot name="menus-primary"></slot>
- </view>
- </view>
- </template>
- <script>
- // #ifdef APP-NVUE
- const animation = weex.requireModule('animation');
- import graceJS from '@/Grace6/js/grace.js';
- // #endif
- export default{
- name : "gui-right-menus",
- props : {
- styles:{type:String, default:'right:20rpx; bottom:200rpx; z-index:9; width:100rpx;'},
- },
- data() {
- return {
- show : false,
- outting : false
- }
- },
- methods:{
- toggle : function () {
- if(this.show){this.close();}else{this.open();}
- },
- open:function () {
- this.show = true;
- this.outting = false;
- // #ifdef APP-NVUE
- graceJS.getRefs('guirightmenu', this, 0, (ref)=>{
- animation.transition(ref, {
- styles : { transform:'translateX(0px)' },
- duration : 200, //ms
- timingFunction : 'ease',
- delay : 0 //ms
- });
- });
- // #endif
- },
- close : function () {
- this.outting = true;
- setTimeout(()=>{ this.show = false; }, 200);
- // #ifdef APP-NVUE
- graceJS.getRefs('guirightmenu', this, 0, (ref)=>{
- animation.transition(ref, {
- styles : { transform:'translateX(100px)' },
- duration : 200, //ms
- timingFunction : 'ease',
- delay : 0 //ms
- });
- });
- // #endif
- }
- }
- }
- </script>
- <style scoped>
- /* #ifndef APP-NVUE */
- @import "@/Grace6/css/animate.css";
- .gui-rt-menus-animate{animation-duration:200ms; animation-timing-function:linear;}
- /* #endif */
- /* #ifdef APP-NVUE */
- .gui-rt-menus-animate{transform:translateX(100px);}
- /* #endif */
- .gui-right-menus{position:fixed;}
- </style>
|