zydx-plus 1.30.156 → 1.30.157
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/editor/src/editor.vue +17 -9
- package/src/index.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<we-toolbar v-show="!readOnly && toolbar.length > 0" class="toolbar" :handle="handle"/>
|
|
3
|
-
<we-editable v-show="!
|
|
3
|
+
<we-editable v-show="!editableShow" class="editable" :style="{'min-height': height + 'px'}" :handle="handle" v-model:json="formData.html" />
|
|
4
4
|
<div class="but" v-if="!readOnly && toolbar.length > 0">
|
|
5
5
|
<button class="def-but" v-if="butShow" @click="confirm">完成</button>
|
|
6
6
|
</div>
|
|
@@ -31,7 +31,8 @@ export default defineComponent({
|
|
|
31
31
|
components: {WeEditable, WeToolbar},
|
|
32
32
|
data() {
|
|
33
33
|
return {
|
|
34
|
-
htmlArr: []
|
|
34
|
+
htmlArr: [],
|
|
35
|
+
editableShow: false
|
|
35
36
|
}
|
|
36
37
|
},
|
|
37
38
|
props: {
|
|
@@ -77,29 +78,35 @@ export default defineComponent({
|
|
|
77
78
|
html: {
|
|
78
79
|
handler: function (e, oldVal) {
|
|
79
80
|
this.formData.html = e
|
|
80
|
-
if(this.readOnly)
|
|
81
|
+
if(this.readOnly) {
|
|
82
|
+
this.editableShow = false
|
|
83
|
+
setTimeout(() => {
|
|
84
|
+
this.editableShow = true
|
|
85
|
+
if(this.readOnly) this.readOnlyPage()
|
|
86
|
+
},0)
|
|
87
|
+
}
|
|
81
88
|
},
|
|
82
|
-
deep: true
|
|
89
|
+
deep: true,
|
|
90
|
+
immediate: true
|
|
83
91
|
},
|
|
84
92
|
readOnly: {
|
|
85
93
|
handler: function (e, oldVal) {
|
|
86
94
|
this.opts.editable.config.readOnly = e
|
|
95
|
+
this.editableShow = e
|
|
87
96
|
if(e) this.readOnlyPage()
|
|
88
97
|
},
|
|
89
98
|
deep: true
|
|
90
99
|
},
|
|
91
100
|
},
|
|
92
101
|
mounted() {
|
|
93
|
-
this.$nextTick(() => {
|
|
94
|
-
|
|
95
|
-
})
|
|
102
|
+
// this.$nextTick(() => {
|
|
103
|
+
// if(this.readOnly) this.readOnlyPage()
|
|
104
|
+
// })
|
|
96
105
|
window.closeMaker = this.closeMaker
|
|
97
|
-
|
|
98
106
|
},
|
|
99
107
|
methods: {
|
|
100
108
|
readOnlyPage() {
|
|
101
109
|
this.htmlArr = []
|
|
102
|
-
this.syncContent() //强制同步数据
|
|
103
110
|
const data = document.querySelectorAll('.w-e-scroll')[0].childNodes[0].childNodes
|
|
104
111
|
let pHeight = 0
|
|
105
112
|
let html = ''
|
|
@@ -119,6 +126,7 @@ export default defineComponent({
|
|
|
119
126
|
break
|
|
120
127
|
}
|
|
121
128
|
}
|
|
129
|
+
console.log(this.htmlArr)
|
|
122
130
|
},
|
|
123
131
|
closeMaker(data) {
|
|
124
132
|
this.$emit('enclosure',data)
|