diff --git a/src/components/scTableSelect/index.vue b/src/components/scTableSelect/index.vue index 785e471e..f79aa175 100644 --- a/src/components/scTableSelect/index.vue +++ b/src/components/scTableSelect/index.vue @@ -12,23 +12,25 @@
- + - + +
+ +
@@ -44,42 +46,85 @@ }, data() { return { + tags: [ + { + value: '1', + label: '黄金糕' + }, + { + value: '2', + label: '双皮奶' + } + ], visible: false, tableData: [{ - date: '2016-05-02', - name: '王小虎', - address: '上海市普陀区金沙江路 1518 弄' - }, { - date: '2016-05-04', - name: '王小虎', - address: '上海市普陀区金沙江路 1517 弄' - }, { - date: '2016-05-01', - name: '王小虎', - address: '上海市普陀区金沙江路 1519 弄' - }, { - date: '2016-05-03', - name: '王小虎', - address: '上海市普陀区金沙江路 1516 弄' - }] + id: '10', + name: '王小虎', + address: '上海市普陀区金沙江路 1518 弄' + }, { + id: '11', + name: '张小帅', + address: '上海市普陀区金沙江路 1517 弄' + }, { + id: '12', + name: '刘先发', + address: '上海市普陀区金沙江路 1519 弄' + }, { + id: '13', + name: '张三', + address: '上海市普陀区金沙江路 1516 弄' + }] } }, watch:{ - + tags: { + handler(){ + console.log("1"); + this.setInputHeight() + }, + deep: true + } }, mounted() { - console.log(this.$refs.popover); + this.setInputHeight() }, methods: { - + setInputHeight(){ + this.$nextTick(() => { + this.$refs.input.input.style.height = this.$refs.tags.clientHeight + 6 + 'px' + }) + }, + deleteTag(index){ + this.tags.splice(index, 1); + }, + selectionChange(selection){ + selection.forEach(item => { + this.tags.push({ + value: item.id, + label: item.name + }) + }) + } } }