Commit 284f851f authored by FE-安焕焕's avatar FE-安焕焕 👣

编辑器传值

parent 87943b08
<template> <template>
<div> <div>
<textarea id="editor" rows="10" cols="80"></textarea> <textarea id="editor" rows="10" cols="80" v-model='value'></textarea>
</div> </div>
</template> </template>
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
...@@ -23,6 +23,10 @@ ...@@ -23,6 +23,10 @@
}, },
tokenUrl: { tokenUrl: {
default: '' default: ''
},
value: {
require: true,
default: ''
} }
}, },
data() { data() {
...@@ -35,7 +39,6 @@ ...@@ -35,7 +39,6 @@
}, },
computed: {}, computed: {},
methods: { methods: {
init () { init () {
CKEDITOR.replace('editor', { CKEDITOR.replace('editor', {
height: this.height, height: this.height,
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div> <div>
<!-- bidirectional data binding(双向数据绑定) --> <!-- bidirectional data binding(双向数据绑定) -->
<Modal v-model='modal' fullscreen> <Modal v-model='modal' fullscreen>
<editor @getValue='getInfo' :uploadUrl='uploadUrl'></editor> <editor @getValue='getInfo' :uploadUrl='uploadUrl' :value='value'></editor>
<div slot='footer'> <div slot='footer'>
<Button @click='getInfo'>获取内容</Button> <Button @click='getInfo'>获取内容</Button>
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
content: '<h2>I am Example</h2>', content: '<h2>I am Example</h2>',
content1: '<h2>I am Example</h2>', content1: '<h2>I am Example</h2>',
uploadUrl: '', uploadUrl: '',
value: '22',
editorOption: { editorOption: {
// some quill options // some quill options
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment