cnetong-core-frontend
Version:
## 1. 开始使用 ```js // 在npm项目中的main.js文件中加入以下代码 import Base from "cnetong-core-frontend";
32 lines (30 loc) • 682 B
JavaScript
import Emitter from "element-ui/lib/mixins/emitter";
/**
* 选择器基础类
*/
export default {
mixins: [Emitter],
data() {
return {};
},
methods: {
/**
* 响应选中 一条
* @param {Object} row
*/
selectTableRow(row) {
// 如果在 EtSelector 中包裹,要通知
this.dispatch("EtSelector", "selectTableRow", row);
this.$emit("select", row);
},
/**
* 响应选中 一组
* @param {Array} selection
*/
selectTable(selection) {
// 如果在 EtSelector 中包裹,要通知
this.dispatch("EtSelector", "selectTable", [selection]);
this.$emit("select", [selection]);
}
}
};