index.vue 2.2KB

123456789101112131415161718192021222324252627
  1. <template>
  2. <uni-shadow-root class="vant-dist-transition-index"><view v-if="inited" :class="'van-transition custom-class '+(classes)" :style="computed.rootStyle({ currentDuration, display, customStyle })" @transitionend="onTransitionEnd">
  3. <slot></slot>
  4. </view></uni-shadow-root>
  5. </template>
  6. <wxs src="./index.wxs" module="computed"></wxs>
  7. <script>
  8. global['__wxRoute'] = 'vant/dist/transition/index'
  9. import { VantComponent } from '../common/component';
  10. import { transition } from '../mixins/transition';
  11. VantComponent({
  12. classes: [
  13. 'enter-class',
  14. 'enter-active-class',
  15. 'enter-to-class',
  16. 'leave-class',
  17. 'leave-active-class',
  18. 'leave-to-class',
  19. ],
  20. mixins: [transition(true)],
  21. });
  22. export default global['__wxComponents']['vant/dist/transition/index']
  23. </script>
  24. <style platform="mp-weixin">
  25. @import '../common/index.css';.van-transition{transition-timing-function:ease}.van-fade-enter-active,.van-fade-leave-active{transition-property:opacity}.van-fade-enter,.van-fade-leave-to{opacity:0}.van-fade-down-enter-active,.van-fade-down-leave-active,.van-fade-left-enter-active,.van-fade-left-leave-active,.van-fade-right-enter-active,.van-fade-right-leave-active,.van-fade-up-enter-active,.van-fade-up-leave-active{transition-property:opacity,transform}.van-fade-up-enter,.van-fade-up-leave-to{transform:translate3d(0,100%,0);opacity:0}.van-fade-down-enter,.van-fade-down-leave-to{transform:translate3d(0,-100%,0);opacity:0}.van-fade-left-enter,.van-fade-left-leave-to{transform:translate3d(-100%,0,0);opacity:0}.van-fade-right-enter,.van-fade-right-leave-to{transform:translate3d(100%,0,0);opacity:0}.van-slide-down-enter-active,.van-slide-down-leave-active,.van-slide-left-enter-active,.van-slide-left-leave-active,.van-slide-right-enter-active,.van-slide-right-leave-active,.van-slide-up-enter-active,.van-slide-up-leave-active{transition-property:transform}.van-slide-up-enter,.van-slide-up-leave-to{transform:translate3d(0,100%,0)}.van-slide-down-enter,.van-slide-down-leave-to{transform:translate3d(0,-100%,0)}.van-slide-left-enter,.van-slide-left-leave-to{transform:translate3d(-100%,0,0)}.van-slide-right-enter,.van-slide-right-leave-to{transform:translate3d(100%,0,0)}
  26. </style>