{"bugs":{"url":"https://github.com/wangeditor-team/wangEditor-for-vue3/issues"},"dist":{"shasum":"1b4d4c639d41d0b2941344ceeb59348440ea41bf","tarball":"https://registry.npmjs.org/@wangeditor/editor-for-vue/-/editor-for-vue-5.1.8-5.tgz","fileCount":14,"integrity":"sha512-YdW/9G60DGZb9TerKlL/XZJBLFnN2xMFdkIrPU8PLrX/5ew0soclOLa/p8tKODYIvoCdWpcimCgXzn1HoViSag==","signatures":[{"sig":"MEQCIEsqFrI+MMTeZ4S8OgikSRyj7ug3aXcrCBOmMBjoTDFtAiB2l94BcDVZ90uCPMrUc3/lC04UwC8pJs3txnV53ubXJw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":72311,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhyRZPCRA9TVsSAnZWagAAIqQQAJ/Y4uDQ7sfNpTSyBnNr\nH0UBAVDUKwywGuU+9og9QRtvKnavHLK/OlvjPdnQnuJLITFjnkUYCaIjCy+D\nb5FggTPJygodrIwO97DsReHB1u7zG5BzgD8f7s9eux9yaSxy7DIS/8wKZGZK\nshL061TqmDkBjk2v96Dz5qvujBJNp0djKvVIBKizWw/Mjz4Vorh//DIbZKQC\nX3pdqTo57IYXGekHa3KsDQWQag6rtGfKwBDWMlkEpR/WEIytYh/sgRMApSys\nhxK9R4h4G+oz/OpfFVbJCcqMw0VvxV2Khoz7k5EXyFOK8h/zOK8tkxfHwPOp\n4S5noyI5cB3wfc7C4Qi7Q8SQP8BcLDM29EtxSuE8lU3aMu2zWyGvHdVheWXb\nJMZAT/9IJEVMM7sQKQWOcS4oT890SYjHj9kgTH8Ae0cLjwpXPVMt1YK2fDl4\nRjtLUa9y+gyLJx94gbYi7cjPRe6XFuPibbKV0KEf8VgdDgwFK/Mot3OgO4mC\nG/znR74j3c319sQNTFneMra6gGj7/41KHuILGSrguyikvron+fLV5kmN3lpn\nuvdliMuswnPQIR5YQuPflNgFLRRtp1OfoZ3aoNKHZsSTMoL1fRWTHcngkRZD\nd2kxaiFT+1FMeWR6IRB8pB2WGM2x73ZymgeLl4jeBhbWcSsFhWL3jwIdjPJR\nriZ7\r\n=a0iX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/index.js","name":"@wangeditor/editor-for-vue","types":"dist/src/index.d.ts","author":{"name":"liuqh0609","email":"liuqh0609@163.com"},"module":"./dist/index.esm.js","readme":"# wangEditor for vue-next component\n\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/facebook/react/blob/main/LICENSE) [![npm](https://img.shields.io/npm/v/@wangeditor/editor-for-vue/next.svg)](https://www.npmjs.com/package/@wangeditor/editor-for-vue/v/next) [![build status](https://github.com/wangeditor-team/wangEditor-for-vue3/actions/workflows/npm-publish.yml/badge.svg?branch=main)](https://github.com/wangeditor-team/wangEditor-for-vue3/actions)\n\n[English documentation](./README-en.md)\n\n## 介绍\n\n基于 [wangEditor](https://www.wangeditor.com/v5/) 封装的开箱即用的 [vue3 组件](https://www.wangeditor.com/v5/guide/for-frame.html#vue3)\n\n## 安装\n\n1. 安装 `wangeditor` 核心包\n\n```shell\nyarn add @wangeditor/editor\n```\n\n2. 安装组件包\n\n```shell\nyarn add @wangeditor/editor-for-vue@next\n```\n\n## 使用\n\n### 模板\n\n```html\n<template>\n  <div style=\"border: 1px solid #ccc\">\n    <!-- 工具栏 -->\n    <Toolbar :editorId=\"editorId\" style=\"border-bottom: 1px solid #ccc\" />\n    <!-- 编辑器 -->\n    <Editor\n      :editorId=\"editorId\"\n      :defaultConfig=\"editorConfig\"\n      :defaultContent=\"getDefaultContent\"\n      @onChange=\"handleChange\"\n      style=\"height: 500px\"\n    />\n  </div>\n</template>\n```\n\n### Script\n\n```ts\nimport '@wangeditor/editor/dist/css/style.css'; // 也可以在 <style> 中 import\n\nimport { computed, onUnmounted } from 'vue';\nimport { Editor, Toolbar, getEditor, removeEditor } from '@wangeditor/editor-for-vue';\nimport cloneDeep from 'lodash.clonedeep';\n\nexport default {\n  name: 'MyEditor',\n  components: { Editor, Toolbar },\n  setup() {\n    const editorId = 'wangEditor-1';\n    // 默认内容\n    const defaultContent = [\n      {\n        type: 'paragraph',\n        children: [{ text: '一行文字' }],\n      },\n    ];\n\n    // 注意，深度拷贝 content ，否则会报错\n    const getDefaultContent = computed(() => cloneDeep(defaultContent));\n\n    // 编辑器配置\n    const editorConfig = {\n      placeholder: '请输入内容...',\n    };\n\n    const handleChange = (editor) => {\n      console.log('change:', editor.children);\n    };\n\n    // 及时销毁编辑器\n    onUnmounted(() => {\n      const editor = getEditor(editorId);\n      if (editor == null) return;\n\n      // 销毁，并移除 editor\n      editor.destroy();\n      removeEditor(editorId);\n    });\n\n    return {\n      editorId,\n      getDefaultContent,\n      editorConfig,\n      handleChange,\n    };\n  },\n};\n```\n","exports":{".":{"import":"./dist/index.esm.js","require":"./dist/index.js"}},"gitHead":"8d3b40ea94385ed6cdd08f2e625578823f500452","license":"MIT","scripts":{"dev":"vite","test":"jest","build":"vue-tsc --noEmit && vite build","serve":"vite preview","release":"release-it"},"_npmUser":{"name":"wangfupeng1988","email":"wangfupeng1988@163.com"},"homepage":"http://www.wangeditor.com/","keywords":["wangEditor","富文本编辑器","富文本","vue3"],"repository":{"url":"git+https://github.com/wangeditor-team/wangEditor-for-vue3.git","type":"git"},"_npmVersion":"6.14.15","description":"wangEditor component for vue@next","directories":{},"maintainers":[{"name":"wangfupeng1988","email":"wangfupeng1988@163.com"}],"_nodeVersion":"14.18.2","dependencies":{"eventemitter3":"^4.0.7"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"vue":"^3.2.7","jest":"25.5.4","vite":"^2.4.4","lodash":"^4.17.21","ts-jest":"^25.3.1","vue-tsc":"^0.2.2","vue-jest":"^5.0.0-alpha.10","babel-jest":"^26.6.3","release-it":"^14.11.5","typescript":"^4.3.2","@types/jest":"^27.0.2","@types/node":"^16.7.1","@types/lodash":"^4.14.172","@vue/test-utils":"^2.0.0-rc.16","vite-plugin-dts":"^0.7.0","@babel/preset-env":"^7.15.8","@vue/compiler-sfc":"^3.0.5","@vitejs/plugin-vue":"^1.3.0","@wangeditor/editor":"^0.13.4","@types/event-emitter":"^0.3.3","@types/lodash.clonedeep":"^4.5.6","@testing-library/jest-dom":"^5.14.1","@typescript-eslint/parser":"^4.29.3"},"peerDependencies":{"vue":"^3.0.5","@wangeditor/editor":"^0.13.4"},"_npmOperationalInternal":{"tmp":"tmp/editor-for-vue_5.1.8-5_1640568399803_0.4582691367258922","host":"s3://npm-registry-packages"},"_id":"@wangeditor/editor-for-vue@5.1.8-5","version":"5.1.8-5"}