|
@@ -46,6 +46,10 @@ export default {
|
|
|
type: String,
|
|
|
default: "",
|
|
|
},
|
|
|
+ isEdit: {
|
|
|
+ type: Boolean,
|
|
|
+ default: true,
|
|
|
+ },
|
|
|
},
|
|
|
watch: {
|
|
|
content(newVal, oldVal) {
|
|
@@ -57,7 +61,7 @@ export default {
|
|
|
methods: {
|
|
|
onCreated(editor) {
|
|
|
this.editor = Object.seal(editor); // 一定要用 Object.seal() ,否则会报错
|
|
|
- // this.html = `<pre><code>${this.content}</code></pre>`;
|
|
|
+ if (!this.isEdit) this.html = `<pre><code></code></pre>`;
|
|
|
},
|
|
|
},
|
|
|
mounted() {
|