tanyanfei 4 лет назад
Родитель
Сommit
f7d42fd0c9
2 измененных файлов с 5 добавлено и 4 удалено
  1. 2 2
      src/components/fuEditor/index.vue
  2. 3 2
      src/views/message/modelForm.vue

+ 2 - 2
src/components/fuEditor/index.vue

@@ -41,9 +41,9 @@ export default {
       }
     },
     value: function(value) {
+      console.log(2333555)
       if (value !== this.editor.txt.html()) {
-        this.editor.txt.html(this.value);
-        
+        this.editor.txt.html(value);
       }
     }
     //value为编辑框输入的内容,这里我监听了一下值,当父组件调用得时候,如果给value赋值了,子组件将会显示父组件赋给的值

+ 3 - 2
src/views/message/modelForm.vue

@@ -412,9 +412,9 @@
                   :close-on-click-modal="false"
                   :visible.sync="dialogVisible"
                 > 
-                    <fuEditor :value="curNote"></fuEditor>
+                    <fuEditor :value="curNote" ref="editor"></fuEditor>
                   <span slot="footer" class="dialog-footer">
-                    <el-button size="small" type="normal" @click="dialogVisible=false,noteForm={}">取消</el-button>
+                    <el-button size="small" type="normal" @click="dialogVisible=false,noteForm={},curNote='<p></p>'">取消</el-button>
                     <el-button size="small" type="primary" @click="saveNote(curItem)">确 定</el-button>
                   </span>
                 </el-dialog>
@@ -584,6 +584,7 @@ export default {
     },
     saveNote(item){
       // this.curItem = item;
+      this.curNote=this.$refs.editor.getEditor()
       this.dialogVisible = false;
     },
     handlePreview(){