|
|
@@ -553,6 +553,29 @@ export default {
|
|
|
// this.$emit('selectContentSetMemo', null, annotationId);
|
|
|
// }
|
|
|
// });
|
|
|
+
|
|
|
+ editor.on('focus', () => {
|
|
|
+ const body = editor.getBody();
|
|
|
+ if (body && body.hasAttribute('data-mce-placeholder')) {
|
|
|
+ body.removeAttribute('data-mce-placeholder');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ editor.on('blur', () => {
|
|
|
+ const body = editor.getBody();
|
|
|
+ const content = editor.getContent({ format: 'text' }).trim();
|
|
|
+ if (body && !content && this.placeholder) {
|
|
|
+ body.setAttribute('data-mce-placeholder', this.placeholder);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ editor.on('input', () => {
|
|
|
+ const body = editor.getBody();
|
|
|
+ const content = editor.getContent({ format: 'text' }).trim();
|
|
|
+ if (body && content && body.hasAttribute('data-mce-placeholder')) {
|
|
|
+ body.removeAttribute('data-mce-placeholder');
|
|
|
+ } else if (body && !content && !body.hasAttribute('data-mce-placeholder') && this.placeholder) {
|
|
|
+ body.setAttribute('data-mce-placeholder', this.placeholder);
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
font_formats:
|
|
|
'楷体=楷体,微软雅黑;' +
|