index.vue 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <template>
  2. <uni-shadow-root class="vant-row-index"><view class="van-row custom-class" :style="computed.rootStyle({ gutter })">
  3. <slot></slot>
  4. </view></uni-shadow-root>
  5. </template>
  6. <wxs src="./index.wxs" module="computed"></wxs>
  7. <script>
  8. global['__wxRoute'] = 'vant/row/index'
  9. import { VantComponent } from '../common/component';
  10. import { useChildren } from '../common/relation';
  11. VantComponent({
  12. relation: useChildren('col', function (target) {
  13. const { gutter } = this.data;
  14. if (gutter) {
  15. target.setData({ gutter });
  16. }
  17. }),
  18. props: {
  19. gutter: {
  20. type: Number,
  21. observer: 'setGutter',
  22. },
  23. },
  24. methods: {
  25. setGutter() {
  26. this.children.forEach((col) => {
  27. col.setData(this.data);
  28. });
  29. },
  30. },
  31. });
  32. export default global['__wxComponents']['vant/row/index']
  33. </script>
  34. <style platform="mp-weixin">
  35. @import '../common/index.css';.van-row:after{clear:both;content:"";display:table}
  36. </style>