| | |
| | | <template> |
| | | <div> |
| | | <quill-editor ref="text" v-model="content" class="myQuillEditor" :options="editorOption" /> |
| | | <el-button type="primary" @click="submit">提交</el-button> |
| | | <div class="box"> |
| | | 新闻标题:<el-input v-model="title" placeholder="请输入新闻标题"></el-input><br/><br/> |
| | | 发布日期:<el-input v-model="releaseTime" placeholder="请输入新闻发布日期"></el-input> |
| | | 新闻内容:<quill-editor ref="text" v-model="content" class="myQuillEditor" :options="editorOption" /> |
| | | <el-button type="primary" @click="submit">确定</el-button> |
| | | <el-button type="success">提交</el-button> |
| | | </div> |
| | | </template> |
| | | <script> |
| | |
| | | import 'quill/dist/quill.core.css' |
| | | import 'quill/dist/quill.snow.css' |
| | | import 'quill/dist/quill.bubble.css' |
| | | |
| | | export default { |
| | | components:{ quillEditor }, |
| | | data () { |
| | | data(){ |
| | | return { |
| | | content: '', |
| | | editorOption: {} , |
| | | title:'', //标题内容 |
| | | releaseTime:'', //发布日期 |
| | | content: '', //新闻内容 |
| | | editorOption: { |
| | | placeholder: "请输入正文", |
| | | } , //编辑器新闻对象 |
| | | } |
| | | }, |
| | | methods: { |
| | | created(){ |
| | | }, |
| | | methods:{ |
| | | submit () { |
| | | console.log(this.$refs.text.value) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style lang="less" scoped> |
| | | // .myQuillEditor{ |
| | | // height: 400px; |
| | | // } |
| | | |
| | | <style lang="less" scoped> |
| | | .box{ |
| | | width: 1200px; |
| | | margin: 0 auto; |
| | | } |
| | | </style> |