|
@@ -55,7 +55,7 @@
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="template-item" v-if="!hideDelete">
|
|
|
+ <!-- <div class="template-item" v-if="!hideDelete">
|
|
|
<div class="label">
|
|
|
操作:
|
|
|
</div>
|
|
@@ -64,7 +64,7 @@
|
|
|
删除该条
|
|
|
</a-tag>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
@@ -112,7 +112,13 @@ export default {
|
|
|
this.time = setTimeout(() => {
|
|
|
if (this.itemData.hasOwnProperty('imagetextlist')) {
|
|
|
if (!this.itemData.imagetextlist.length) { // 没有值
|
|
|
- this.itemData.imagetextlist = []
|
|
|
+ this.itemData.imagetextlist = [{
|
|
|
+ picurl: '',
|
|
|
+ title: '',
|
|
|
+ media_id: '',
|
|
|
+ description: '', // 图文描述
|
|
|
+ url: ''
|
|
|
+ }]
|
|
|
this.$forceUpdate()
|
|
|
} else { // 有值
|
|
|
this.$nextTick(_ => {
|
|
@@ -128,23 +134,22 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}, 1000)
|
|
|
-
|
|
|
this.$once('hook:beforeDestory', () => {
|
|
|
clearTimeout(this.time)
|
|
|
})
|
|
|
},
|
|
|
watch: {
|
|
|
- addStatus: {
|
|
|
- handler () {
|
|
|
- if (this.itemData.imagetextlist.length < 8) {
|
|
|
- const aa = this.itemData.imagetextlist.concat([JSON.parse(JSON.stringify(this.editContainer))])
|
|
|
- this.$set(this.itemData, 'imagetextlist', aa)
|
|
|
- } else {
|
|
|
- this.$message.error('最多只能添加8条')
|
|
|
- }
|
|
|
- this.$forceUpdate()
|
|
|
- }
|
|
|
- }
|
|
|
+ // addStatus: {
|
|
|
+ // handler () {
|
|
|
+ // if (this.itemData.imagetextlist.length < 8) {
|
|
|
+ // const aa = this.itemData.imagetextlist.concat([JSON.parse(JSON.stringify(this.editContainer))])
|
|
|
+ // this.$set(this.itemData, 'imagetextlist', aa)
|
|
|
+ // } else {
|
|
|
+ // this.$message.error('最多只能添加8条')
|
|
|
+ // }
|
|
|
+ // this.$forceUpdate()
|
|
|
+ // }
|
|
|
+ // }
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
@@ -185,16 +190,22 @@ export default {
|
|
|
* index 编辑器的索引位置
|
|
|
* */
|
|
|
handleEditInnerDom ($dom, index) {
|
|
|
- console.log(index, 'indexjindex')
|
|
|
+ console.log(index, $dom, 'indexjindex')
|
|
|
+ const editBox = this.$refs[`edit_${index}`][0]
|
|
|
+ console.log(editBox, 'editBox')
|
|
|
if ($dom) {
|
|
|
this.$nextTick(() => {
|
|
|
- const editBox = this.$refs[`edit_${index}`][0]
|
|
|
if (editBox) {
|
|
|
editBox.innerDom($dom)
|
|
|
this.$forceUpdate()
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+ // else { // 解决focus失焦问题
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ // editBox.innerDom($dom)
|
|
|
+ // })
|
|
|
+ // }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -210,8 +221,8 @@ export default {
|
|
|
}
|
|
|
|
|
|
/deep/ .ant-form {
|
|
|
- border-bottom: 1px solid #d8d8d8;
|
|
|
- margin-bottom: 20px;
|
|
|
+ // border-bottom: 1px solid #d8d8d8;
|
|
|
+ // margin-bottom: 20px;
|
|
|
}
|
|
|
|
|
|
.add-image-text {
|