mirror of
https://github.com/vxcontrol/ncform.git
synced 2026-07-18 16:24:27 -04:00
docs(ncform-theme-elementui): Add disableReorder demo for array-tabs
This commit is contained in:
committed by
Dmitry Nagibin
parent
b52330ed9c
commit
c86c191de5
@@ -160,6 +160,29 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: {
|
||||
cn: '[属性] disableReorder: 是否禁止排序',
|
||||
en: '[ATTR] disableReorder: whether to disable sorting'
|
||||
},
|
||||
schema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
user: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'string'
|
||||
},
|
||||
ui: {
|
||||
widget: 'array-tabs',
|
||||
widgetConfig: {
|
||||
disableReorder: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: {
|
||||
cn: '[属性] disableCollapse: 是否禁止折叠',
|
||||
|
||||
@@ -120,21 +120,23 @@
|
||||
mounted() {
|
||||
const vm = this;
|
||||
const el = this.$el.querySelector(".el-tabs__nav");
|
||||
const sortTabs = Sortable.create(el, {
|
||||
animation: 200,
|
||||
filter: ".el-icon-close",
|
||||
dragClass: 'dragging',
|
||||
onEnd(evt) {
|
||||
const list = vm.schema.value;
|
||||
const item = list.splice(evt.oldIndex, 1)[0];
|
||||
list.splice(evt.newIndex, 0, item);
|
||||
vm.schema.value = [];
|
||||
vm.$nextTick(() => {
|
||||
vm.schema.value = list;
|
||||
vm.activeName = String(evt.newIndex);
|
||||
});
|
||||
}
|
||||
});
|
||||
if (!this.mergeConfig.disableReorder) {
|
||||
const sortTabs = Sortable.create(el, {
|
||||
animation: 200,
|
||||
filter: ".el-icon-close",
|
||||
dragClass: 'dragging',
|
||||
onEnd(evt) {
|
||||
const list = vm.schema.value;
|
||||
const item = list.splice(evt.oldIndex, 1)[0];
|
||||
list.splice(evt.newIndex, 0, item);
|
||||
vm.schema.value = [];
|
||||
vm.$nextTick(() => {
|
||||
vm.schema.value = list;
|
||||
vm.activeName = String(evt.newIndex);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
Reference in New Issue
Block a user