zydx-plus 1.28.125 → 1.28.127
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zydx-plus",
|
|
3
|
-
"version": "1.28.
|
|
3
|
+
"version": "1.28.127",
|
|
4
4
|
"description": "Vue.js",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"files": [
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"@tiptap/starter-kit": "^2.0.3",
|
|
33
33
|
"@tiptap/vue-3": "^2.0.3",
|
|
34
34
|
"@tiptap/extension-text-align": "^2.0.3",
|
|
35
|
+
"@tiptap/extension-placeholder": "^2.0.3",
|
|
35
36
|
"@vue-office/docx": "^1.1.3",
|
|
36
37
|
"@vue-office/excel": "^1.1.3"
|
|
37
38
|
},
|
|
@@ -81,6 +81,7 @@ import { Editor, EditorContent } from '@tiptap/vue-3'
|
|
|
81
81
|
import StarterKit from '@tiptap/starter-kit'
|
|
82
82
|
import Image from '@tiptap/extension-image'
|
|
83
83
|
import TextAlign from '@tiptap/extension-text-align'
|
|
84
|
+
import Placeholder from '@tiptap/extension-placeholder'
|
|
84
85
|
export default {
|
|
85
86
|
name: 'zydx-xiao-editor',
|
|
86
87
|
components: {
|
|
@@ -177,6 +178,10 @@ export default {
|
|
|
177
178
|
enclosureShow: {
|
|
178
179
|
type: Boolean,
|
|
179
180
|
default: true
|
|
181
|
+
},
|
|
182
|
+
placeholder: {
|
|
183
|
+
type: String,
|
|
184
|
+
default: ''
|
|
180
185
|
}
|
|
181
186
|
},
|
|
182
187
|
emits: ['see','del','complete','update:data','enclosureSuccess','download','updateData'],
|
|
@@ -208,6 +213,9 @@ export default {
|
|
|
208
213
|
editable: this.readOnly,
|
|
209
214
|
extensions: [
|
|
210
215
|
StarterKit,
|
|
216
|
+
Placeholder.configure({
|
|
217
|
+
placeholder: this.placeholder,
|
|
218
|
+
}),
|
|
211
219
|
TextAlign.configure({
|
|
212
220
|
types: ['heading', 'paragraph'],
|
|
213
221
|
}),
|
|
@@ -382,6 +390,13 @@ export default {
|
|
|
382
390
|
</script>
|
|
383
391
|
|
|
384
392
|
<style scoped>
|
|
393
|
+
:deep(.ProseMirror) p.is-editor-empty:first-child::before {
|
|
394
|
+
content: attr(data-placeholder);
|
|
395
|
+
float: left;
|
|
396
|
+
color: #adb5bd;
|
|
397
|
+
pointer-events: none;
|
|
398
|
+
height: 0;
|
|
399
|
+
}
|
|
385
400
|
:deep(.editor-img){
|
|
386
401
|
max-width: 100%;
|
|
387
402
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<div class="preface-left">
|
|
4
4
|
<span>题序设置:</span>
|
|
5
5
|
<div class="preface-input">
|
|
6
|
-
<input type="number" @input="numbers" @keypress="isNumberKey($event)" />
|
|
6
|
+
<input type="number" :value="inputValue" @input="numbers" @keypress="isNumberKey($event)" />
|
|
7
7
|
</div>
|
|
8
8
|
</div>
|
|
9
9
|
<div class="preface-right">
|
|
@@ -32,8 +32,37 @@ export default {
|
|
|
32
32
|
inputValue: ''
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
|
+
props: {
|
|
36
|
+
value: {
|
|
37
|
+
type: Object,
|
|
38
|
+
default: () => {
|
|
39
|
+
return {
|
|
40
|
+
diffLeve: 1,
|
|
41
|
+
quesNo: ''
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
watch: {
|
|
47
|
+
value: {
|
|
48
|
+
handler: function (val, oldVal) {
|
|
49
|
+
this.updateData(val)
|
|
50
|
+
},
|
|
51
|
+
immediate: true
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
mounted() {
|
|
55
|
+
this.updateData(this.value)
|
|
56
|
+
},
|
|
35
57
|
emits: ['change'],
|
|
36
58
|
methods: {
|
|
59
|
+
updateData(v) {
|
|
60
|
+
this.radioValue = v.diffLeve;
|
|
61
|
+
this.radioList.map(x => {
|
|
62
|
+
x.checked = x.value === v.diffLeve;
|
|
63
|
+
})
|
|
64
|
+
this.inputValue = v.quesNo;
|
|
65
|
+
},
|
|
37
66
|
radioTao(v) {
|
|
38
67
|
this.radioValue = v;
|
|
39
68
|
this.$emit('change', {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
'min-height': height + 'px',
|
|
5
5
|
border: (readable)? '1px solid #ccc': 'none',
|
|
6
6
|
'background-color': (readable)? '#fff': 'transparent'
|
|
7
|
-
}" @input="event => checkLength(event, maxLength)" :contenteditable="readable" ref="textarea"></div>
|
|
7
|
+
}" @input="event => checkLength(event, maxLength)" :placeholder="placeholder" :contenteditable="readable" ref="textarea"></div>
|
|
8
8
|
<span class="num" v-if="maxLength !== 0&&readable">{{ num }}/{{ maxLength }}</span>
|
|
9
9
|
</div>
|
|
10
10
|
</template>
|
|
@@ -17,7 +17,8 @@ export default {
|
|
|
17
17
|
components: {Textarea},
|
|
18
18
|
data() {
|
|
19
19
|
return {
|
|
20
|
-
num: 0
|
|
20
|
+
num: 0,
|
|
21
|
+
placeholder: ''
|
|
21
22
|
}
|
|
22
23
|
},
|
|
23
24
|
props: {
|
|
@@ -36,6 +37,10 @@ export default {
|
|
|
36
37
|
readable: {
|
|
37
38
|
type: Boolean,
|
|
38
39
|
default: true
|
|
40
|
+
},
|
|
41
|
+
placeholder: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: ''
|
|
39
44
|
}
|
|
40
45
|
},
|
|
41
46
|
watch: {
|
|
@@ -88,4 +93,8 @@ export default {
|
|
|
88
93
|
box-sizing: border-box;
|
|
89
94
|
background-color: #fff;
|
|
90
95
|
}
|
|
96
|
+
.text[contenteditable]:empty:before {
|
|
97
|
+
content: attr(placeholder);
|
|
98
|
+
color: gray;
|
|
99
|
+
}
|
|
91
100
|
</style>
|