index.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <template>
  2. <view :class="'custom-class ' + utils.bem('goods-action', { safe: safeAreaInsetBottom })">
  3. <slot />
  4. </view>
  5. </template>
  6. <script module="utils" lang="wxs" src="@/node_modules/@vant/weapp/dist/wxs/utils.wxs"></script>
  7. <script>
  8. import { VantComponent } from '../common/component';
  9. export default {
  10. data() {
  11. return {};
  12. },
  13. '../goods-action-button/index': {
  14. type: 'descendant',
  15. name: 'goods-action-button',
  16. current: 'goods-action',
  17. linked() {
  18. this.updateStyle();
  19. },
  20. unlinked() {
  21. this.updateStyle();
  22. },
  23. linkChanged() {
  24. this.updateStyle();
  25. }
  26. },
  27. props: {
  28. safeAreaInsetBottom: {
  29. type: Boolean,
  30. default: true
  31. }
  32. },
  33. methods: {
  34. updateStyle() {
  35. this.$nextTick(() => {
  36. this.children.forEach((child) => {
  37. child.updateStyle();
  38. });
  39. });
  40. }
  41. }
  42. };
  43. </script>
  44. <style>
  45. @import './index.css';
  46. </style>