提交 5edcb6c5 编写于 作者: S shenjizhe

1

上级 1547eea4
......@@ -4,7 +4,10 @@
<!-- 表头行 -->
<uni-tr class="data-row" @mousedown="onMouseDown">
<uni-th class="column-css" v-for="(col, key, index) in columns" :key="key">{{ col.info }}</uni-th>
<uni-th class="column-css">设置</uni-th>
<uni-th class="column-css">
设置
<button class="button-plugs" @click="onAddColumn">+</button>
</uni-th>
</uni-tr>
<!-- 表格数据行 -->
<uni-tr class="data-row" v-for="(row, rindex) in datas" :key="rindex" @mousedown.native="onMouseDown(rindex)">
......@@ -110,6 +113,12 @@ export default {
},
onMouseDown(rindex) {
this.$emit('selected', rindex, 'select', this.datas[rindex]);
},
onAddColumn() {
let data = { name: '', info: '', tips: '', type: 'text' };
this.datas.push(data);
let index = this.datas.length-1;
this.$emit('selected', index, 'select', this.datas[index]);
}
}
};
......@@ -156,4 +165,9 @@ $black-color: #3f3f3f;
padding: 0 1.34em;
margin-left: 25rpx;
}
.button-plugs {
font-size: 1em;
color: #2d8cf0;
background-color: #ffffff;
}
</style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册