u-tr.vue 583 B

12345678910111213141516171819202122232425262728293031323334
  1. <template>
  2. <view class="u-tr">
  3. <slot></slot>
  4. </view>
  5. </template>
  6. <script>
  7. /**
  8. * tr 表格行标签
  9. * @description 表格组件一般用于展示大量结构化数据的场景(搭配<u-table>使用)
  10. * @tutorial https://www.uviewui.com/components/table.html
  11. * @example <u-tr></u-tr>
  12. */
  13. export default {
  14. name: "u-tr",
  15. inject: ['uTable', 'uTd'],
  16. provide() {
  17. return {
  18. uTr: this,
  19. };
  20. },
  21. created() {
  22. if (this.uTd && this.uTd.tr) {
  23. this.uTd.tr.push(this);
  24. }
  25. }
  26. }
  27. </script>
  28. <style lang="scss" scoped>
  29. .u-tr {
  30. display: flex;
  31. }
  32. </style>