增强 WPS 的图文混合粘贴功能,针对 WORD 或者 WPS 复制后进行粘贴的可能无法处理本地图片文件,自动加上占位图片,以便于手动点击上传
npm install --save vue2-tinymce7
复制node_modules/vue2-tinymce7/dist/tinymce
到public
下
const CopyWebpackPlugin = require("copy-webpack-plugin");
module.exports = {
// ...
plugins: [
// ...
new CopyWebpackPlugin([
{ from: "node_modules/vue2-tinymce7/dist/tinymce", to: "tinymce" },
]),
],
};
import Vue2Tinymce7Component from "vue2-tinymce7";
Vue.use(Vue2TinymceComponent);
import { Vue2Tinymce } from "vue2-tinymce7";
<Vue2Tinymce
:value="value"
:base_url="'/tinymce/'"
@ready="onReady"
@inputChange="onInputChange"
@editorChange="onEditorChange"
>
</Vue2Tinymce>
# 安装
npm install
# 构建库
npm run build-lib
# 运行示例
npm run serve