index.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <template>
  2. <uni-shadow-root class="vant-overlay-index"><root-portal v-if="rootPortal">
  3. <include src="./overlay.wxml"></include>
  4. </root-portal>
  5. <include v-else src="./overlay.wxml"></include></uni-shadow-root>
  6. </template>
  7. <script>
  8. const __wxTemplateComponentProps = {}
  9. import __wxTemplateComponent0 from './overlay.vue'
  10. import VanTransition from '../transition/index.vue'
  11. global['__wxVueOptions'] = {components:{'van-transition': VanTransition,}}
  12. global['__wxRoute'] = 'vant/overlay/index'
  13. import { VantComponent } from '../common/component';
  14. VantComponent({
  15. props: {
  16. show: Boolean,
  17. customStyle: String,
  18. duration: {
  19. type: null,
  20. value: 300,
  21. },
  22. zIndex: {
  23. type: Number,
  24. value: 1,
  25. },
  26. lockScroll: {
  27. type: Boolean,
  28. value: true,
  29. },
  30. rootPortal: {
  31. type: Boolean,
  32. value: false,
  33. },
  34. },
  35. methods: {
  36. onClick() {
  37. this.$emit('click');
  38. },
  39. // for prevent touchmove
  40. noop() { },
  41. },
  42. });
  43. export default global['__wxComponents']['vant/overlay/index']
  44. </script>
  45. <style platform="mp-weixin">
  46. @import '../common/index.css';.van-overlay{background-color:var(--overlay-background-color,rgba(0,0,0,.7));height:100%;left:0;position:fixed;top:0;width:100%}
  47. </style>