|
@@ -6,6 +6,7 @@
|
|
|
:active-tab-key="selectKey"
|
|
|
@tabChange="onTabChange">
|
|
|
<a-form
|
|
|
+ v-show="model.id"
|
|
|
size="small"
|
|
|
v-if="selectKey === '0'">
|
|
|
<a-form-item label="标题">
|
|
@@ -53,12 +54,12 @@
|
|
|
<template v-if="model.type === 'select'">
|
|
|
<a-form-item label="选项">
|
|
|
<VueDraggable
|
|
|
- v-model="model.options"
|
|
|
+ v-model="model.attrs.options"
|
|
|
:animation="150"
|
|
|
handle=".handle"
|
|
|
>
|
|
|
<div
|
|
|
- v-for="(item, index) in model.options"
|
|
|
+ v-for="(item, index) in model.attrs.options"
|
|
|
:key="index"
|
|
|
class="options"
|
|
|
>
|
|
@@ -75,6 +76,15 @@
|
|
|
<a-button @click="addOption" style="width:100%"><a-icon type="plus" /></a-button>
|
|
|
</a-form-item>
|
|
|
</template>
|
|
|
+ <a-popconfirm
|
|
|
+ title="确定删除该组件?"
|
|
|
+ ok-text="确定"
|
|
|
+ cancel-text="取消"
|
|
|
+ @confirm="deleteModel"
|
|
|
+ >
|
|
|
+ <a-button type="danger" style="width:100%">删除</a-button>
|
|
|
+ </a-popconfirm>
|
|
|
+
|
|
|
</a-form>
|
|
|
<a-form
|
|
|
size="small"
|
|
@@ -133,13 +143,16 @@ export default {
|
|
|
this.config = config
|
|
|
},
|
|
|
addOption () {
|
|
|
- this.model.options.push({
|
|
|
- label: '选项' + (this.model.options.length + 1),
|
|
|
- value: 'newValue' + (this.model.options.length + 1)
|
|
|
+ this.model.attrs.options.push({
|
|
|
+ label: '选项' + (this.model.attrs.options.length + 1),
|
|
|
+ value: 'newValue' + (this.model.attrs.options.length + 1)
|
|
|
})
|
|
|
},
|
|
|
deleteOption (i) {
|
|
|
- this.model.options.splice(i, 1)
|
|
|
+ this.model.attrs.options.splice(i, 1)
|
|
|
+ },
|
|
|
+ deleteModel () {
|
|
|
+
|
|
|
},
|
|
|
onTabChange (key) {
|
|
|
this.selectKey = key
|