wantongjizhi
Version:
Custom components for WANTONG JIZHI
31 lines (30 loc) • 567 B
JavaScript
export default {
name: 'WtGridSortProxy',
inject: ['WtGrid'],
props: {
value: {
type: Object
},
items: {
type: Array
}
},
watch: {
value(val) {
this.WtGrid.sortProps.value = val
},
items(val) {
this.WtGrid.sortProps.items = val
}
},
created() {
this.WtGrid.sortProps.items = this.items
this.WtGrid.sortProps.value = this.value
this.WtGrid.$on('sort-change', ({ value }) => {
this.$emit('input', value)
})
},
render() {
return null
}
}