vxe-table
Version:
一个基于 vue 的 PC 端表格组件,支持增删改查、虚拟滚动、懒加载、快捷菜单、数据校验、树形结构、打印导出、表单渲染、数据分页、虚拟列表、模态窗口、自定义模板、渲染器、贼灵活的配置项、扩展接口等...
50 lines (46 loc) • 944 B
JavaScript
import { createItem, destroyItem, assemItem } from './util'
const props = {
title: String,
field: String,
size: String,
span: [String, Number],
align: String,
titleAlign: String,
titleWidth: [String, Number],
titlePrefix: Object,
titleSuffix: Object,
resetValue: { default: null },
visible: { type: Boolean, default: null },
visibleMethod: Function,
folding: Boolean,
collapseNode: Boolean,
itemRender: Object
}
const watch = {}
Object.keys(props).forEach(name => {
watch[name] = function (value) {
this.itemConfig.update(name, value)
}
})
export default {
name: 'VxeFormItem',
props,
inject: {
$xeform: {
default: null
}
},
watch,
mounted () {
assemItem(this)
},
created () {
this.itemConfig = createItem(this.$xeform, this)
},
destroyed () {
destroyItem(this)
},
render (h) {
return h('div')
}
}