{"bugs":{"url":"https://github.com/wangeditor-team/wangEditor-for-vue3/issues"},"dist":{"shasum":"e82ffa4aa166c4a4d039dac547b329445ac0bd5d","tarball":"https://registry.npmjs.org/@wangeditor/editor-for-vue/-/editor-for-vue-5.1.8-10.tgz","fileCount":14,"integrity":"sha512-OwA7cngDLP2VliIVaEIul+HGYnkJI0FL/NR+75mumb4rqzEvpp+FRZ/pNQ3u/CwJ2t0mPcbgMY0z5kiM5pP+ag==","signatures":[{"sig":"MEYCIQCzvib/u6k0HrHtPNdoKtuAcp1bDc+juVpDSNLE37lgaQIhAMGzjjNzOr4JyjKdAJAJK2BelWAd6wi2IN/Wer+3Kdu+","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":72770,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKWBWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqPuQ/+ODv7Pddjo2SQiTWrOWucRwmQgCGut2KH/cR02/W3W8lKqNqN\r\nE/99mQ03mJq6vgzj4B9SzrFteuRX32fEJG/pIWQ6nOzA6OA+Kai4CVNnbdOQ\r\nodRTxaKOSJUug/uEuUmTCie33YhkB8z9yUh9R5+s/xOyJzBYIoCDQ5S8Bozw\r\nAL4BIfApQLuzr04GGs1v3S0xLzST39YsX7FSLmIiIRcrSWK6dg4O6swfpAEd\r\ncRUQ11MaVcMR3MK+ZKnJD2tOk5Zyj4O/NhZexvTGKYX+HO7bTvzce76xaVCP\r\nU/SuJrCrqAA+Qa3Rou7hjtj8x/I4TwW2hQFqNKVd/5x40KIGzbJ6vwfoUCMJ\r\ne8uTlvcSNcV3s/HksdO2onsCZTDW46kzSpCKAAUNdKOrMFfZjCab7InnfC32\r\nl4beQLk+PjpHoDfjBX73Tmpn0fnkSEmBXURbYoRwgH7D2vbExSLvO2mz8PuC\r\nrFKax96kMbCmVmoW1LDggR5mvuTa8fcYFqAGcncOPBoOrB/oanl6jDAKe448\r\n/G+kDJCJ77SyYEt/4y6lAbVIPYyMUaTVvlsdlxxPsnd1KDYGEZVXLS2zFAFf\r\nZxlQiCueJgsHQqb9ddeRpTbDt9sSkL2UAWwi2PjgDlXHGcq1eZTp5hol34BG\r\n2JhqoX/3UkPtPd4hf/6BXgaMsaW3o/wYBDY=\r\n=hYdh\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":"f891bd0720441d174bd8e512faa2239c5d636fc1","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.16","description":"wangEditor component for vue@next","directories":{},"maintainers":[{"name":"wangfupeng1988","email":"wangfupeng1988@163.com"}],"_nodeVersion":"14.19.0","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","prettier":"^2.5.1","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.15.6","@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.15.6"},"_npmOperationalInternal":{"tmp":"tmp/editor-for-vue_5.1.8-10_1646878806563_0.024148071972580176","host":"s3://npm-registry-packages"},"_id":"@wangeditor/editor-for-vue@5.1.8-10","version":"5.1.8-10"}