zydx-plus 1.30.156 → 1.30.158
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 -11
- 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',opacity: readOnly? '0':'1'}" :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: {
|
|
@@ -76,30 +77,35 @@ export default defineComponent({
|
|
|
76
77
|
watch: {
|
|
77
78
|
html: {
|
|
78
79
|
handler: function (e, oldVal) {
|
|
80
|
+
this.editableShow = false
|
|
79
81
|
this.formData.html = e
|
|
80
|
-
if(this.readOnly)
|
|
82
|
+
if(this.readOnly) {
|
|
83
|
+
setTimeout(() => {
|
|
84
|
+
this.editableShow = true
|
|
85
|
+
this.readOnlyPage()
|
|
86
|
+
},10)
|
|
87
|
+
}
|
|
81
88
|
},
|
|
82
|
-
deep: true
|
|
89
|
+
deep: true,
|
|
90
|
+
immediate: true
|
|
83
91
|
},
|
|
84
92
|
readOnly: {
|
|
85
93
|
handler: function (e, oldVal) {
|
|
86
|
-
this.
|
|
94
|
+
this.editableShow = e
|
|
87
95
|
if(e) this.readOnlyPage()
|
|
88
96
|
},
|
|
89
97
|
deep: true
|
|
90
98
|
},
|
|
91
99
|
},
|
|
92
100
|
mounted() {
|
|
93
|
-
this.$nextTick(() => {
|
|
94
|
-
|
|
95
|
-
})
|
|
101
|
+
// this.$nextTick(() => {
|
|
102
|
+
// if(this.readOnly) this.readOnlyPage()
|
|
103
|
+
// })
|
|
96
104
|
window.closeMaker = this.closeMaker
|
|
97
|
-
|
|
98
105
|
},
|
|
99
106
|
methods: {
|
|
100
107
|
readOnlyPage() {
|
|
101
108
|
this.htmlArr = []
|
|
102
|
-
this.syncContent() //强制同步数据
|
|
103
109
|
const data = document.querySelectorAll('.w-e-scroll')[0].childNodes[0].childNodes
|
|
104
110
|
let pHeight = 0
|
|
105
111
|
let html = ''
|
|
@@ -147,7 +153,7 @@ export default defineComponent({
|
|
|
147
153
|
editable: {
|
|
148
154
|
config: {
|
|
149
155
|
placeholder: props.placeholder,
|
|
150
|
-
readOnly:
|
|
156
|
+
readOnly: false,
|
|
151
157
|
// autoFocus: (props.html !== ''),
|
|
152
158
|
autoFocus: true, // 自动聚焦
|
|
153
159
|
MENU_CONF: {
|