From e7b0b34176549cfec809c6b89c4cab0999e488b9 Mon Sep 17 00:00:00 2001 From: qingyiay <2386314947@qq.com> Date: 星期二, 28 三月 2023 16:40:56 +0800 Subject: [PATCH] 修改大部分问题 --- uni_modules/uni-table/components/uni-td/uni-td.vue | 138 +++++++++++++++++++++++----------------------- 1 files changed, 69 insertions(+), 69 deletions(-) diff --git a/uni_modules/uni-table/components/uni-td/uni-td.vue b/uni_modules/uni-table/components/uni-td/uni-td.vue index 9ce93e9..ecfb882 100644 --- a/uni_modules/uni-table/components/uni-td/uni-td.vue +++ b/uni_modules/uni-table/components/uni-td/uni-td.vue @@ -1,90 +1,90 @@ <template> <!-- #ifdef H5 --> - <td class="uni-table-td" :rowspan="rowspan" :colspan="colspan" :class="{'table--border':border}" :style="{width:width + 'px','text-align':align}"> + <td class="uni-table-td" @click="getRow" :rowspan="rowspan" :colspan="colspan" :class="{ 'table--border': border }" :style="{ width: width + 'px', 'text-align': align }"> <slot></slot> </td> <!-- #endif --> <!-- #ifndef H5 --> <!-- :class="{'table--border':border}" --> - <view class="uni-table-td" :class="{'table--border':border}" :style="{width:width + 'px','text-align':align}"> - <slot></slot> - </view> + <view class="uni-table-td" @click="getRow" :class="{ 'table--border': border }" :style="{ width: width + 'px', 'text-align': align }"><slot></slot></view> <!-- #endif --> - </template> <script> - /** - * Td 鍗曞厓鏍� - * @description 琛ㄦ牸涓殑鏍囧噯鍗曞厓鏍肩粍浠� - * @tutorial https://ext.dcloud.net.cn/plugin?id=3270 - * @property {Number} align = [left|center|right] 鍗曞厓鏍煎榻愭柟寮� - */ - export default { - name: 'uniTd', - options: { - virtualHost: true +/** + * Td 鍗曞厓鏍� + * @description 琛ㄦ牸涓殑鏍囧噯鍗曞厓鏍肩粍浠� + * @tutorial https://ext.dcloud.net.cn/plugin?id=3270 + * @property {Number} align = [left|center|right] 鍗曞厓鏍煎榻愭柟寮� + */ +export default { + name: 'uniTd', + options: { + virtualHost: true + }, + props: { + width: { + type: [String, Number], + default: '' }, - props: { - width: { - type: [String, Number], - default: '' - }, - align: { - type: String, - default: 'left' - }, - rowspan: { - type: [Number,String], - default: 1 - }, - colspan: { - type: [Number,String], - default: 1 + align: { + type: String, + default: 'left' + }, + rowspan: { + type: [Number, String], + default: 1 + }, + colspan: { + type: [Number, String], + default: 1 + } + }, + data() { + return { + border: false + }; + }, + created() { + this.root = this.getTable(); + this.border = this.root.border; + }, + methods: { + getRow() { + this.$emit('row-click'); + }, + /** + * 鑾峰彇鐖跺厓绱犲疄渚� + */ + getTable() { + let parent = this.$parent; + let parentName = parent.$options.name; + while (parentName !== 'uniTable') { + parent = parent.$parent; + if (!parent) return false; + parentName = parent.$options.name; } - }, - data() { - return { - border: false - }; - }, - created() { - this.root = this.getTable() - this.border = this.root.border - }, - methods: { - /** - * 鑾峰彇鐖跺厓绱犲疄渚� - */ - getTable() { - let parent = this.$parent; - let parentName = parent.$options.name; - while (parentName !== 'uniTable') { - parent = parent.$parent; - if (!parent) return false; - parentName = parent.$options.name; - } - return parent; - }, + return parent; } } +}; </script> <style lang="scss"> - $border-color:#EBEEF5; +$border-color: #ebeef5; - .uni-table-td { - display: table-cell; - padding: 8px 10px; - font-size: 14px; - border-bottom: 1px $border-color solid; - font-weight: 400; - color: #606266; - line-height: 23px; - box-sizing: border-box; - } +.uni-table-td { + display: table-cell; + padding: 8px 10px; + font-size: 14px; + border-bottom: 1px $border-color solid; + font-weight: 400; + color: #606266; + line-height: 23px; + box-sizing: border-box; +} - .table--border { - border-right: 1px $border-color solid; - } +.table--border { + border-right: 1px $border-color solid; +} </style> -- Gitblit v1.9.1