zydx-plus 1.28.125 → 1.28.126

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.125",
3
+ "version": "1.28.126",
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
  }
@@ -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>
package/src/index.js CHANGED
@@ -67,7 +67,7 @@ function install(app) {
67
67
  }
68
68
 
69
69
  export default {
70
- version: '1.28.125',
70
+ version: '1.28.126',
71
71
  install,
72
72
  Calendar,
73
73
  Message,