diff --git a/package-lock.json b/package-lock.json index 2f2c824..dfd884f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "name": "code-brick-wd", "version": "0.1.0", "dependencies": { - "code-brick-zj": "^0.0.1", + "code-brick-zj": "^0.0.4", "core-js": "^3.8.3", "element-ui": "^2.15.12", "vue": "^2.6.14", @@ -4007,9 +4007,9 @@ } }, "node_modules/code-brick-zj": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/code-brick-zj/-/code-brick-zj-0.0.1.tgz", - "integrity": "sha512-XLvQEoiVWESDirkMKVKCIdH1jW3drkSS472uMWd1m6Ul5UVTUAiJvBQ15kEo+L7w8Zt7cC5ErF+laYHhNeoaIA==" + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/code-brick-zj/-/code-brick-zj-0.0.4.tgz", + "integrity": "sha512-KSQ/drfIpoZKTrcARtuwG+6olde7fBYl+38Kialqa1NSoSDhPMqXTVw2N4KfA4MlucXQ/s3KZjfUsmKVZ70KkA==" }, "node_modules/color-convert": { "version": "1.9.3", @@ -14473,9 +14473,9 @@ } }, "code-brick-zj": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/code-brick-zj/-/code-brick-zj-0.0.1.tgz", - "integrity": "sha512-XLvQEoiVWESDirkMKVKCIdH1jW3drkSS472uMWd1m6Ul5UVTUAiJvBQ15kEo+L7w8Zt7cC5ErF+laYHhNeoaIA==" + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/code-brick-zj/-/code-brick-zj-0.0.4.tgz", + "integrity": "sha512-KSQ/drfIpoZKTrcARtuwG+6olde7fBYl+38Kialqa1NSoSDhPMqXTVw2N4KfA4MlucXQ/s3KZjfUsmKVZ70KkA==" }, "color-convert": { "version": "1.9.3", diff --git a/package.json b/package.json index f44264e..b165c48 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "lint": "vue-cli-service lint" }, "dependencies": { - "code-brick-zj": "^0.0.1", + "code-brick-zj": "^0.0.4", "core-js": "^3.8.3", "element-ui": "^2.15.12", "vue": "^2.6.14", diff --git a/src/views/table/singleHead.vue b/src/views/table/singleHead.vue index 1aea838..116e309 100644 --- a/src/views/table/singleHead.vue +++ b/src/views/table/singleHead.vue @@ -318,7 +318,11 @@
current-change
事件来管理选中时触发的事件,它会传入currentRow
,oldCurrentRow
。
+ 使用按钮选中取消,必须要传id,id的值是唯一的,id的值需要和setCurrent
中第一参数一样。
+ <el-button size="small" @click="setCurrent(1)">选中第二行</el-button> + <el-button size="small" @click="setCurrent(-1)">取消选中</el-button> <template> <base-table + ref="palletTable1" + id="palletTable" :table-props="tableProps" :table-data="tableData" :page="1" @@ -345,6 +354,10 @@ @current-change="handleCurrentChange" /> </template> + methods: + setCurrent(index) { + this.$refs.palletTable1.setCurrent('palletTable', index) + }