7 Star 61 Fork 9

packy-tang / vue-tinymce

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

vue-tinymce

vue-tinymce

npm version vue tinymce NPM downloads

提供给 vue 开发者使用的 TinyMCE 组件

目的

为开发人员简单使用 TinyMCE 的 Vue 组件。提供非常简单易懂的源代码提供给开发人员作为参考,当然你也可以直接使用这个组件到你的项目。发现问题可以提到 issue,期望你的反馈 👏。

如何使用

安装组件

yarn add @packy-tang/vue-tinymce
# or
npm install @packy-tang/vue-tinymce

引入

<template>
    <!-- 全局引入TinyMCE -->
    <script src="//unpkg.com/tinymce@5.1.5/tinymce.min.js"></script>
    <!-- App -->
    <div id="app">
        <vue-tinymce
            v-model="content"
            :setup="setup"
            :setting="setting" />
    </div>
</template>
<script>
    import Vue from "vue"
    import VueTinymce from "@packy-tang/vue-tinymce"

    //安装组件
    Vue.use(VueTinymce)

    new Vue({
        el: "#app",
        data: function() {
            return {
                content: "<p>html content</p>",
                setting: {
                    height: 500
                }
            }
        },
        methods: {
            setup(editor) {
                console.log(editor)
            }
        }
    })
</script>

其他使用例子

  • vue-cli使用例子:传送门
  • webpack使用例子:传送门(待补上)

属性

名称 描述
:content 类型String,作为文本内容传入编辑器,可以使用v-model实现双向绑定
@change 类型Function,编辑器中Input Change Undo Redo ExecCommand KeyUp NodeChange事件响应后触发的事件返回文本内容
:setting 类型Object,编辑器的设置,setup不建议在这设置
:setup 类型Function, 常用与自定义编辑器处理,组件内部做了些处理,建议在这里添加自定义的代码

更多使用细节

想了解更多内容请移步至使用细节

本地调试

# 运行本地例子
$ npm run serve 
# 构建
$ npm run build
# 发布版本
$ npm run release

构建支持

本仓库由sao-esm作为模板构建。

License

Copyright (c) packy-tang lpreterite@126.com

根据MIT协议的开源软件.

The MIT License (MIT) Copyright (c) lpreterite <lpreterite@126.com> (https://github.com/lpreterite/) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

提供给 vue 开发者使用的 TinyMCE 组件 展开 收起
JavaScript 等 5 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/packy-tang/vue-tinymce.git
git@gitee.com:packy-tang/vue-tinymce.git
packy-tang
vue-tinymce
vue-tinymce
master

搜索帮助