使用vue制作富文本框

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_24147051/article/details/83755154

这里分享一个富文本框插件,如图
在这里插入图片描述

使用方法:

1-安装

 npm install --save vue2-editor
      或者
 yarn add vue2-editor

2- 使用

// Basic Use - Covers most scenarios
import { VueEditor } from 'vue2-editor'
 
// Advanced Use - Hook into Quill's API for Custom Functionality
import { VueEditor, Quill } from 'vue2-editor'

3- 在项目中使用

<template>
   <div id="app">
     <vue-editor v-model="content"></vue-editor>
   </div>
 </template>
 
 <script>
   import { VueEditor } from 'vue2-editor'
 
   export default {
 
   components: {
      VueEditor
   },
 
   data() {
       return {
         content: '<h1>Some initial content</h1>'  
       }
     }
   }
 </script> 

可以参考 https://www.npmjs.com/package/vue2-editor 这网站

猜你喜欢

转载自blog.csdn.net/qq_24147051/article/details/83755154
今日推荐