项目
在 GitHub 查看
chmln/vue-wysiwyg
关于
适用于 Vue.js 的轻量级所见即所得 HTML 编辑器
网站与应用开发实测星标增长
- 24小时
- -1
- 7天
- -1
- 15天
- -1
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Usage
Install vue-wysiwyg
npm install vue-wysiwyg --save
OR
yarn add vue-wysiwyg
In your main.js:
import wysiwyg from "vue-wysiwyg";
Vue.use(wysiwyg, {}); // config is optional. more below
Also make sure to load the stylesheet. The exact syntax will depend on what preprocessor you use.
@import "~vue-wysiwyg/dist/vueWysiwyg.css";
In your components:
<wysiwyg v-model="myHTML" />
Config options
All keys are optional.
{
// { [module]: boolean (set true to hide) }
hideModules: { "bold": true },
// you can override icons too, if desired
// just keep in mind that you may need custom styles in your application to get everything to align
iconOverrides: { "bold": "<i class='your-custom-icon'></i>" },
// if the image option is not set, images are inserted as base64
image: {
uploadURL: "/api/myEndpoint",
dropzoneOptions: {}
},
// limit content height if you wish. If not set, editor size will grow with content.
maxHeight: "500px",
// set to 'true' this will insert plain text without styling when you paste something into the editor.
forcePlainTextOnPaste: true,
// specify editor locale, if you don't specify this, the editor will default to english.
locale: 'hu'
}
Available Modules:
- bold
- italic
- underline
- justifyLeft
- justifyCenter
- justifyRight
- headings
- link
- code
- orderedList
- unorderedList
- image
- table
- removeFormat
- separator
Available Locales:
- english (default)
- hungarian
- dutch
- german
Note on the image upload API endpoint:
- Image is uploaded by
multipart/form-data - Your endpoint must respond back with a string, the URL for the image - e.g.
http://myapp.com/images/12345.jpg
探索相关项目
加载中…
