|
@@ -6,7 +6,11 @@
|
|
|
ref="editor"
|
|
|
@input="input"
|
|
|
></div>
|
|
|
- <div v-if="!rawText" class="defaultText" v-html="defaultSl + dfaultText"></div>
|
|
|
+ <div
|
|
|
+ v-if="!rawText"
|
|
|
+ class="defaultText"
|
|
|
+ v-html="defaultSl + dfaultText"
|
|
|
+ ></div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
@@ -24,17 +28,21 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
dfaultText: config.base.default_text || '',
|
|
|
- defaultSl: '<p style="margin: 10px auto; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 16px; line-height: 34.2px; font-family: "Microsoft Yahei" color: rgb(51, 51, 51); background-color: rgb(255, 255, 255);"><span>(示例)</span></p>'
|
|
|
+ defaultSl:
|
|
|
+ '<p style="margin: 10px auto; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 16px; line-height: 34.2px; font-family: "Microsoft Yahei" color: rgb(51, 51, 51); background-color: rgb(255, 255, 255);"><span>(示例)</span></p>',
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
|
rawText(val) {
|
|
|
-
|
|
|
this.$refs.editor.innerHTML = val;
|
|
|
},
|
|
|
},
|
|
|
beforeMount() {},
|
|
|
- methods: {},
|
|
|
+ methods: {
|
|
|
+ input(e) {
|
|
|
+ this.$emit('update:rawText', e.target.innerHTML || '');
|
|
|
+ },
|
|
|
+ },
|
|
|
emits: ['update:rawText'],
|
|
|
};
|
|
|
</script>
|