index.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <template>
  2. <uni-shadow-root class="vant-goods-action-index"><view :class="'custom-class '+(utils.bem('goods-action', { safe: safeAreaInsetBottom }))">
  3. <slot></slot>
  4. </view></uni-shadow-root>
  5. </template>
  6. <wxs src="../wxs/utils.wxs" module="utils"></wxs>
  7. <script>
  8. global['__wxRoute'] = 'vant/goods-action/index'
  9. import { VantComponent } from '../common/component';
  10. VantComponent({
  11. relation: {
  12. type: 'descendant',
  13. name: 'goods-action-button',
  14. linked(child) {
  15. this.children.push(child);
  16. },
  17. unlinked(child) {
  18. this.children = this.children.filter((item) => item !== child);
  19. }
  20. },
  21. beforeCreate() {
  22. this.children = [];
  23. },
  24. props: {
  25. safeAreaInsetBottom: {
  26. type: Boolean,
  27. value: true
  28. }
  29. }
  30. });
  31. export default global['__wxComponents']['vant/goods-action/index']
  32. </script>
  33. <style platform="mp-weixin">
  34. @import '../common/index.css';.van-goods-action{position:fixed;right:0;bottom:0;left:0;display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;background-color:#fff;background-color:var(--goods-action-background-color,#fff)}.van-goods-action--safe{padding-bottom:env(safe-area-inset-bottom)}
  35. </style>