使用vue制作富文本框
生活随笔
收集整理的這篇文章主要介紹了
使用vue制作富文本框
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
這里分享一個富文本框插件,如圖
使用方法:
1-安裝
npm install --save vue2-editor或者yarn add vue2-editor2- 使用
// 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 這網站
總結
以上是生活随笔為你收集整理的使用vue制作富文本框的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 手写一个二级选择框联动
- 下一篇: 工商银行灵通卡和储蓄卡区别