table.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <template>
  2. <view>
  3. <!-- table -->
  4. <block v-if="data.tag === 'table'">
  5. <view class="h2w__tableParent">
  6. <view :class="data.attrs.class" :width="data.attrs.width" :style="data.attrs.style">
  7. <!-- thead、tbody、tfoot -->
  8. <block v-if="data.children" v-for="(item, index) in data.children" :key="index">
  9. <view v-if="item.tag" :class="item.attrs.class">
  10. <!-- tr -->
  11. <block v-if="item.children" v-for="(item, index1) in item.children" :key="index1">
  12. <view v-if="item.tag" :class="item.attrs.class">
  13. <!-- td -->
  14. <block v-if="item.children" v-for="(item, index2) in item.children" :key="index2">
  15. <view v-if="item.tag" :class="item.attrs.class" :width="data.attrs.width" :style="data.attrs.style">
  16. <!-- content -->
  17. <decode v-if="item.children" :nodes="item" />
  18. </view>
  19. </block>
  20. </view>
  21. </block>
  22. </view>
  23. </block>
  24. </view>
  25. </view>
  26. </block>
  27. </view>
  28. </template>
  29. <script>
  30. import decode from '../decode';
  31. export default {
  32. components: {
  33. decode
  34. },
  35. data() {
  36. return {};
  37. },
  38. options: {
  39. styleIsolation: 'shared'
  40. },
  41. props: {
  42. data: {
  43. type: Object,
  44. default: () => ({})
  45. }
  46. },
  47. methods: {},
  48. created: function () {}
  49. };
  50. </script>
  51. <style></style>