vhb-table
Version:
一个基于 vue 的 PC 端表格组件,支持增删改查、虚拟列表、虚拟树、懒加载、快捷菜单、数据校验、树形结构、打印导出、表单渲染、数据分页、弹窗、自定义模板、渲染器、贼灵活的配置项、扩展接口等...
39 lines (32 loc) • 689 B
JavaScript
import XEUtils from 'xe-utils'
import { warnLog } from '../../tools/log'
/**
* 创建数据仓库
*/
class Store {
constructor () {
this.store = {}
}
mixin (map) {
Object.assign(this.store, map)
return Store
}
get (name) {
return this.store[name]
}
add (name, render) {
// 检测是否覆盖
if (process.env.VUE_APP_VHB_TABLE_ENV === 'development') {
if (!XEUtils.eqNull(this.store[name]) && this.store[name] !== render) {
warnLog('vhb.error.coverProp', [this._name, name])
}
}
this.store[name] = render
return Store
}
delete (name) {
delete this.store[name]
return Store
}
}
export default Store