ant.vue富文本编辑器
Vue-Trix文字编辑器 (Vue-Trix Text Editor)
Simple and lightweight Trix rich-text editor component for Vue.js.
Vue.js的简单轻量级Trix RTF编辑器组件。
安装 (Installation)
NPM
NPM
$npm install --save vue-trix
YARN
纱
$yarn add vue-trix
安装 (Mount)
全局安装 (Mount with global)
in the main.js
, import the package as a global component.
在main.js
,将包作为全局组件导入。
import 'vue-trix'
安装组件 (Mount with component)
import VueTrix from 'vue-trix'
export default {
// ...
components: {
VueTrix
}
}
组件用法 (Component Usages)
创建一个简单的编辑器 (Create a simple editor)
Add VueTrix
component into *.vue
template
将VueTrix
组件添加到*.vue
模板中
<template>
<!-- ... -->
<VueTrix v-model="editorContent"/>
<!-- ... -->
</template>
与表格整合 (Integrating with Forms)
<form ...>
<VueTrix inputId="editor1" v-model="editorContent"/>
</form>
道具说明 (Props descriptions)
inputId
: This is referencedid
of the hidden input field definedinputId
:这是定义的隐藏输入字段的参考id
翻译自: https://vuejsexamples.com/simple-and-lightweight-trix-rich-text-editor-component-for-vue-js/
ant.vue富文本编辑器