{"id":70338,"date":"2026-02-01T20:05:20","date_gmt":"2026-02-01T12:05:20","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/70338.html"},"modified":"2026-02-01T20:05:20","modified_gmt":"2026-02-01T12:05:20","slug":"%e5%9c%a8-vue-3-%e4%b8%ad%e9%9b%86%e6%88%90-wangeditor-%e5%af%8c%e6%96%87%e6%9c%ac%e7%bc%96%e8%be%91%e5%99%a8%ef%bc%9a%e4%bb%8e%e5%9f%ba%e7%a1%80%e5%88%b0%e5%ae%9e%e6%88%98","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/70338.html","title":{"rendered":"\u5728 Vue 3 \u4e2d\u96c6\u6210 WangEditor \u5bcc\u6587\u672c\u7f16\u8f91\u5668\uff1a\u4ece\u57fa\u7840\u5230\u5b9e\u6218"},"content":{"rendered":"<p>\u4f9d\u8d56\u5305&#xff1a;&#064;wangeditor\/editor-for-vue&#064;5.1.12<\/p>\n<p>\u5bcc\u6587\u672c\u7f16\u8f91\u5668\u662f\u73b0\u4ee3 Web \u5e94\u7528\u4e2d\u4e0d\u53ef\u6216\u7f3a\u7684\u7ec4\u4ef6&#xff0c;\u5c24\u5176\u5728 CMS\u3001\u535a\u5ba2\u3001\u540e\u53f0\u7ba1\u7406\u7cfb\u7edf\u7b49\u573a\u666f\u4e2d\u5e7f\u6cdb\u4f7f\u7528\u3002\u672c\u6587\u5c06\u5e26\u4f60\u4e00\u6b65\u6b65\u5728 Vue 3 \u9879\u76ee\u4e2d\u96c6\u6210 WangEditor&#xff08;\u56fd\u4ea7\u5f00\u6e90\u5bcc\u6587\u672c\u7f16\u8f91\u5668&#xff09;&#xff0c;\u5e76\u901a\u8fc7\u4e00\u4e2a\u5b8c\u6574\u7684 index.vue \u7ec4\u4ef6\u793a\u4f8b&#xff0c;\u8be6\u7ec6\u89e3\u6790\u5176\u914d\u7f6e\u9879\u3001\u4e8b\u4ef6\u5904\u7406\u3001\u56fe\u7247\u4e0a\u4f20\u3001\u8868\u683c\u652f\u6301\u53ca\u53ea\u8bfb\u6a21\u5f0f\u7b49\u9ad8\u7ea7\u529f\u80fd\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"612\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260201120519-697f417f1618a.png\" width=\"925\" \/><\/p>\n<hr \/>\n<h3>\u4e00\u3001\u4e3a\u4ec0\u4e48\u9009\u62e9 WangEditor&#xff1f;<\/h3>\n<p>WangEditor \u662f\u4e00\u6b3e\u8f7b\u91cf\u3001\u6613\u7528\u3001\u4e2d\u6587\u6587\u6863\u5b8c\u5584\u7684\u56fd\u4ea7\u5bcc\u6587\u672c\u7f16\u8f91\u5668&#xff0c;\u5177\u6709\u4ee5\u4e0b\u4f18\u52bf&#xff1a;<\/p>\n<ul>\n<li>\u539f\u751f\u652f\u6301 Vue\/React<\/li>\n<li>\u63d2\u4ef6\u5316\u67b6\u6784&#xff0c;\u53ef\u6309\u9700\u6269\u5c55<\/li>\n<li>\u652f\u6301 Markdown\u3001\u8868\u683c\u3001\u4ee3\u7801\u5757\u3001\u516c\u5f0f\u7b49<\/li>\n<li>\u56fe\u7247\/\u89c6\u9891\u4e0a\u4f20\u914d\u7f6e\u7075\u6d3b<\/li>\n<li>\u793e\u533a\u6d3b\u8dc3&#xff0c;\u4e2d\u6587\u652f\u6301\u597d<\/li>\n<\/ul>\n<p>\u672c\u6587\u57fa\u4e8e &#064;wangeditor\/editor-for-vue&#xff08;v5&#043;&#xff09;&#xff0c;\u9002\u7528\u4e8e Vue 3 Composition API\u3002<\/p>\n<hr \/>\n<h3>\u4e8c\u3001\u5b89\u88c5\u4f9d\u8d56<\/h3>\n<p>npm install &#064;wangeditor\/editor-for-vue &#064;wangeditor\/editor<\/p>\n<p>\u6ce8\u610f&#xff1a;editor-for-vue \u662f Vue \u5c01\u88c5\u5c42&#xff0c;\u5e95\u5c42\u4ecd\u4f9d\u8d56 &#064;wangeditor\/editor\u3002<\/p>\n<p>\u540c\u65f6\u5f15\u5165 CSS \u6837\u5f0f&#xff1a;<\/p>\n<p>import &#039;&#064;wangeditor\/editor\/dist\/css\/style.css&#039;<\/p>\n<hr \/>\n<h3>\u4e09\u3001\u5b8c\u6574\u7ec4\u4ef6\u4ee3\u7801\u89e3\u6790&#xff08;index.vue&#xff09;<\/h3>\n<p>\u4ee5\u4e0b\u662f\u6211\u4eec\u5728\u9879\u76ee\u4e2d\u5c01\u88c5\u7684\u5bcc\u6587\u672c\u7ec4\u4ef6&#xff0c;\u652f\u6301\u5185\u5bb9\u4f20\u5165\u3001\u9ad8\u5ea6\u63a7\u5236\u3001\u53ea\u8bfb\u6a21\u5f0f\u3001\u56fe\u7247\u4e0a\u4f20\u3001\u8868\u683c\u64cd\u4f5c\u7b49\u3002<\/p>\n<h4>1. \u6a21\u677f\u7ed3\u6784<\/h4>\n<p>&lt;template&gt;<br \/>\n  &lt;div style&#061;&#034;border: 1px solid #ccc&#034;&gt;<br \/>\n    &lt;!&#8211; \u5de5\u5177\u680f &#8211;&gt;<br \/>\n    &lt;Toolbar<br \/>\n      v-if&#061;&#034;showToolbarFlag&#034;<br \/>\n      :editor&#061;&#034;editorRef&#034;<br \/>\n      :defaultConfig&#061;&#034;toolbarConfig&#034;<br \/>\n      :mode&#061;&#034;mode&#034;<br \/>\n      style&#061;&#034;border-bottom: 1px solid #ccc&#034;<br \/>\n    \/&gt;<br \/>\n    &lt;!&#8211; \u7f16\u8f91\u5668\u4e3b\u4f53 &#8211;&gt;<br \/>\n    &lt;Editor<br \/>\n      v-model&#061;&#034;valueHtml&#034;<br \/>\n      :defaultConfig&#061;&#034;editorConfig&#034;<br \/>\n      :mode&#061;&#034;mode&#034;<br \/>\n      &#064;onCreated&#061;&#034;handleCreated&#034;<br \/>\n      &#064;onChange&#061;&#034;handleChange&#034;<br \/>\n      :style&#061;&#034;{ height: editorHeight, overflowY: &#039;hidden&#039; }&#034;<br \/>\n      :readOnly&#061;&#034;readOnlyFlag&#034;<br \/>\n    \/&gt;<br \/>\n  &lt;\/div&gt;<br \/>\n&lt;\/template&gt;<\/p>\n<ul>\n<li>\u4f7f\u7528 &lt;Toolbar&gt; \u548c &lt;Editor&gt; \u4e24\u4e2a\u7ec4\u4ef6\u3002<\/li>\n<li>\u901a\u8fc7 v-model \u7ed1\u5b9a HTML \u5185\u5bb9&#xff08;\u5b9e\u9645\u901a\u8fc7 valueHtml \u624b\u52a8\u540c\u6b65&#xff09;\u3002<\/li>\n<li>readOnly \u63a7\u5236\u662f\u5426\u53ef\u7f16\u8f91&#xff08;\u4f46\u66f4\u63a8\u8350\u4f7f\u7528 editor.disable()&#xff0c;\u89c1\u4e0b\u6587&#xff09;\u3002<\/li>\n<\/ul>\n<hr \/>\n<h4>2. \u811a\u672c\u903b\u8f91&#xff08;Composition API &#043; TypeScript&#xff09;<\/h4>\n<h5>&#xff08;1&#xff09;\u5f15\u5165\u4e0e Props \u5b9a\u4e49<\/h5>\n<p>import { Editor, Toolbar } from &#039;&#064;wangeditor\/editor-for-vue&#039;<br \/>\nimport &#039;&#064;wangeditor\/editor\/dist\/css\/style.css&#039;<br \/>\nimport base from &#034;&#064;\/utils\/base.js&#034;<\/p>\n<p>const props &#061; defineProps({<br \/>\n  content: { type: String, default: &#039;&#039; },<br \/>\n  showToolbarFlag: { type: Boolean, default: true },<br \/>\n  editorHeight: { type: String, default: &#039;500px&#039; },<br \/>\n  readOnlyFlag: { type: Boolean, default: false }<br \/>\n})<\/p>\n<p>const emit &#061; defineEmits([&#039;update&#039;])<\/p>\n<ul>\n<li>content&#xff1a;\u7236\u7ec4\u4ef6\u4f20\u5165\u7684 HTML \u5b57\u7b26\u4e32\u3002<\/li>\n<li>update \u4e8b\u4ef6&#xff1a;\u5c06\u7f16\u8f91\u540e\u7684\u5185\u5bb9\u56de\u4f20\u7ed9\u7236\u7ec4\u4ef6&#xff0c;\u5b9e\u73b0\u201c\u53cc\u5411\u7ed1\u5b9a\u201d\u3002<\/li>\n<\/ul>\n<h5>&#xff08;2&#xff09;\u54cd\u5e94\u5f0f\u53d8\u91cf<\/h5>\n<p>const mode &#061; ref(&#039;default&#039;)<br \/>\nconst editorRef &#061; shallowRef() \/\/ \u5fc5\u987b\u7528 shallowRef&#xff0c;\u907f\u514d Vue \u6df1\u5ea6\u8ffd\u8e2a<br \/>\nconst valueHtml &#061; ref(&#039;&#039;)<\/p>\n<p>\u26a0\ufe0f \u6ce8\u610f&#xff1a;editorRef \u5fc5\u987b\u4f7f\u7528 shallowRef&#xff0c;\u56e0\u4e3a\u7f16\u8f91\u5668\u5b9e\u4f8b\u5305\u542b\u5927\u91cf\u975e\u54cd\u5e94\u5f0f\u5c5e\u6027&#xff0c;\u6df1\u5ea6\u54cd\u5e94\u4f1a\u5bfc\u81f4\u6027\u80fd\u95ee\u9898\u751a\u81f3\u62a5\u9519\u3002<\/p>\n<h5>&#xff08;3&#xff09;\u7f16\u8f91\u5668\u914d\u7f6e editorConfig<\/h5>\n<p>const editorConfig &#061; {<br \/>\n  placeholder: &#039;\u8bf7\u8f93\u5165\u5185\u5bb9,\u5355\u4e2a\u6587\u4ef6\u7684\u6700\u592710MB&#8230;&#039;,<br \/>\n  MENU_CONF: {<br \/>\n    \/\/ \u8868\u683c\u914d\u7f6e<br \/>\n    insertTable: {<br \/>\n      withBorder: true,<br \/>\n      maxRow: 10,<br \/>\n      maxCol: 6,<br \/>\n      onInserted(tableNode) {<br \/>\n        console.log(&#039;\u63d2\u5165\u7684\u8868\u683c:&#039;, tableNode)<br \/>\n      }<br \/>\n    },<br \/>\n    \/\/ \u8868\u683c\u60ac\u505c\u5de5\u5177\u680f\u81ea\u5b9a\u4e49<br \/>\n    hoverbarKeys: {<br \/>\n      table: {<br \/>\n        menuKeys: [<br \/>\n          &#039;tableHeader&#039;,<br \/>\n          &#039;insertTableRow&#039;, &#039;deleteTableRow&#039;,<br \/>\n          &#039;insertTableCol&#039;, &#039;deleteTableCol&#039;,<br \/>\n          &#039;deleteTable&#039;<br \/>\n        ]<br \/>\n      }<br \/>\n    }<br \/>\n  }<br \/>\n}<\/p>\n<h6>\u8868\u683c\u529f\u80fd\u8bf4\u660e&#xff1a;<\/h6>\n<ul>\n<li>withBorder: true&#xff1a;\u9ed8\u8ba4\u5e26\u8fb9\u6846\u3002<\/li>\n<li>maxRow\/maxCol&#xff1a;\u9650\u5236\u884c\u5217\u6570&#xff0c;\u9632\u6b62\u9875\u9762\u5361\u987f\u3002<\/li>\n<li>hoverbarKeys&#xff1a;\u81ea\u5b9a\u4e49\u8868\u683c\u60ac\u505c\u65f6\u663e\u793a\u7684\u64cd\u4f5c\u83dc\u5355\u3002<\/li>\n<\/ul>\n<h5>&#xff08;4&#xff09;\u56fe\u7247\u4e0a\u4f20\u914d\u7f6e<\/h5>\n<p>editorConfig.MENU_CONF[&#039;uploadImage&#039;] &#061; {<br \/>\n  fieldName: &#039;file&#039;, \/\/ \u540e\u7aef\u63a5\u6536\u7684\u5b57\u6bb5\u540d<br \/>\n  server: &#096;${base.baseUrl}${base.project}\/admin\/oss\/upload&#096;,<br \/>\n  maxFileSize: 10 * 1024 * 1024, \/\/ 10MB<br \/>\n  maxNumberOfFiles: 10,<br \/>\n  allowedFileTypes: [&#039;image\/*&#039;],<br \/>\n  timeout: 10000,<br \/>\n  meta: {<br \/>\n    token: sessionStorage.getItem(&#034;token&#034;) \/\/ \u643a\u5e26\u8ba4\u8bc1\u4fe1\u606f<br \/>\n  },<br \/>\n  \/\/ \u81ea\u5b9a\u4e49\u63d2\u5165\u903b\u8f91<br \/>\n  customInsert(res, insertFn, file) {<br \/>\n    \/\/ \u5047\u8bbe\u540e\u7aef\u8fd4\u56de { url: &#039;https:\/\/xxx.jpg&#039; }<br \/>\n    insertFn(res.url, res.url, res.url)<br \/>\n  },<br \/>\n  onFailed(file, res) {<br \/>\n    console.log(&#096;${file.name} \u4e0a\u4f20\u5931\u8d25&#096;, res)<br \/>\n  }<br \/>\n}<\/p>\n<p>\u2705 \u5173\u952e\u70b9&#xff1a;<\/p>\n<ul>\n<li>customInsert \u51b3\u5b9a\u4e86\u5982\u4f55\u5c06\u4e0a\u4f20\u7ed3\u679c\u63d2\u5165\u7f16\u8f91\u5668\u3002<\/li>\n<li>meta \u53ef\u643a\u5e26 token\u3001\u7528\u6237 ID \u7b49&#xff0c;\u7528\u4e8e\u540e\u7aef\u9274\u6743\u3002<\/li>\n<li>fieldName \u5fc5\u987b\u4e0e\u540e\u7aef\u63a5\u53e3\u53c2\u6570\u540d\u4e00\u81f4\u3002<\/li>\n<\/ul>\n<h5>&#xff08;5&#xff09;\u751f\u547d\u5468\u671f\u4e0e\u4e8b\u4ef6\u5904\u7406<\/h5>\n<h6>\u521d\u59cb\u5316\u7f16\u8f91\u5668<\/h6>\n<p>const handleCreated &#061; (editor) &#061;&gt; {<br \/>\n  editorRef.value &#061; editor<br \/>\n  if (props.readOnlyFlag) {<br \/>\n    editor.disable() \/\/ \u771f\u6b63\u7684\u53ea\u8bfb&#xff08;\u6bd4 :readOnly \u66f4\u53ef\u9760&#xff09;<br \/>\n  } else {<br \/>\n    editor.enable()<br \/>\n  }<br \/>\n}<\/p>\n<p>&#x1f4cc; \u63a8\u8350\u4f7f\u7528 editor.disable() \u800c\u975e :readOnly \u5c5e\u6027&#xff0c;\u540e\u8005\u5728\u67d0\u4e9b\u7248\u672c\u4e2d\u53ef\u80fd\u5931\u6548\u3002<\/p>\n<h6>\u5185\u5bb9\u53d8\u5316\u76d1\u542c<\/h6>\n<p>const handleChange &#061; () &#061;&gt; {<br \/>\n  valueHtml.value &#061; editorRef.value.getHtml()<br \/>\n  emit(&#039;update&#039;, valueHtml.value)<br \/>\n}<\/p>\n<h6>\u76d1\u542c\u7236\u7ec4\u4ef6 content \u66f4\u65b0<\/h6>\n<p>watch(() &#061;&gt; props.content, (newVal) &#061;&gt; {<br \/>\n  nextTick(() &#061;&gt; {<br \/>\n    if (editorRef.value) {<br \/>\n      editorRef.value.setHtml(newVal)<br \/>\n      valueHTML.value &#061; newVal<br \/>\n    }<br \/>\n  })<br \/>\n})<\/p>\n<p>&#x1f4a1; \u4f7f\u7528 nextTick \u786e\u4fdd DOM \u66f4\u65b0\u540e\u518d\u64cd\u4f5c\u7f16\u8f91\u5668\u3002<\/p>\n<h6>\u5ef6\u8fdf\u521d\u59cb\u5316&#xff08;\u9632\u9519\u5904\u7406&#xff09;<\/h6>\n<p>onMounted(async () &#061;&gt; {<br \/>\n  await nextTick()<br \/>\n  setTimeout(() &#061;&gt; {<br \/>\n    if (props.content &amp;&amp; editorRef.value) {<br \/>\n      try {<br \/>\n        editorRef.value.setHtml(props.content)<br \/>\n      } catch (error) {<br \/>\n        \/\/ \u9632\u6b62\u975e\u6cd5 HTML&#xff08;\u5982\u672a\u95ed\u5408\u6807\u7b7e&#xff09;\u5bfc\u81f4\u5d29\u6e83<br \/>\n        const cleanHtml &#061; props.content.replace(\/&lt;table[^&gt;]*&gt;.*?&lt;\\\\\/table&gt;\/gis, &#039;&#039;)<br \/>\n        editorRef.value.setHtml(cleanHtml || &#039;&lt;p&gt;&lt;\/p&gt;&#039;)<br \/>\n      }<br \/>\n    }<br \/>\n  }, 100)<br \/>\n})<\/p>\n<p>\u2705 \u52a0\u5165 try-catch \u548c\u8868\u683c\u6e05\u7406&#xff0c;\u63d0\u5347\u9c81\u68d2\u6027\u3002<\/p>\n<h6>\u9500\u6bc1\u7f16\u8f91\u5668&#xff08;\u5185\u5b58\u6cc4\u6f0f\u9632\u62a4&#xff09;<\/h6>\n<p>onBeforeUnmount(() &#061;&gt; {<br \/>\n  editorRef.value?.destroy()<br \/>\n})<\/p>\n<hr \/>\n<h4>3. \u6837\u5f0f\u5b9a\u5236&#xff08;\u8868\u683c\u7f8e\u5316&#xff09;<\/h4>\n<p>&lt;style scoped&gt;<br \/>\n.w-e-table {<br \/>\n  border-collapse: collapse;<br \/>\n  width: 100%;<br \/>\n  margin: 10px 0;<br \/>\n}<br \/>\n.w-e-table td, .w-e-table th {<br \/>\n  border: 1px solid #ddd;<br \/>\n  padding: 8px;<br \/>\n  min-width: 50px;<br \/>\n  height: 20px;<br \/>\n  vertical-align: top;<br \/>\n}<br \/>\n.w-e-table th {<br \/>\n  background-color: #f2f2f2;<br \/>\n  text-align: left;<br \/>\n}<br \/>\n&lt;\/style&gt;<\/p>\n<p>WangEditor \u7684\u8868\u683c\u9ed8\u8ba4\u6837\u5f0f\u8f83\u7b80\u964b&#xff0c;\u53ef\u901a\u8fc7\u8986\u76d6 .w-e-table \u7c7b\u8fdb\u884c\u7f8e\u5316\u3002<\/p>\n<hr \/>\n<h3>\u56db\u3001\u7236\u7ec4\u4ef6\u4f7f\u7528\u793a\u4f8b<\/h3>\n<p>&lt;template&gt;<br \/>\n  &lt;RichTextEditor<br \/>\n    :content&#061;&#034;article.content&#034;<br \/>\n    &#064;update&#061;&#034;handleContentUpdate&#034;<br \/>\n    :editorHeight&#061;&#034;&#039;400px&#039;&#034;<br \/>\n    :readOnlyFlag&#061;&#034;isPreviewMode&#034;<br \/>\n  \/&gt;<br \/>\n&lt;\/template&gt;<\/p>\n<p>&lt;script setup&gt;<br \/>\nconst article &#061; reactive({ content: &#039;&lt;p&gt;\u521d\u59cb\u5185\u5bb9&lt;\/p&gt;&#039; })<br \/>\nconst handleContentUpdate &#061; (html) &#061;&gt; {<br \/>\n  article.content &#061; html<br \/>\n}<br \/>\nconst isPreviewMode &#061; false<br \/>\n&lt;\/script&gt;<\/p>\n<hr \/>\n<h3>\u4e94\u3001\u5e38\u89c1\u95ee\u9898\u4e0e\u89e3\u51b3\u65b9\u6848<\/h3>\n<table>\n<tr>\u95ee\u9898\u89e3\u51b3\u65b9\u6848<\/tr>\n<tbody>\n<tr>\n<td>\u7f16\u8f91\u5668\u5185\u5bb9\u4e0d\u66f4\u65b0<\/td>\n<td>\u786e\u4fdd\u4f7f\u7528 editor.setHtml() \u800c\u975e\u76f4\u63a5\u8d4b\u503c v-model<\/td>\n<\/tr>\n<tr>\n<td>\u56fe\u7247\u4e0a\u4f20 401<\/td>\n<td>\u68c0\u67e5 meta \u662f\u5426\u643a\u5e26\u6709\u6548 token<\/td>\n<\/tr>\n<tr>\n<td>\u8868\u683c\u6837\u5f0f\u9519\u4e71<\/td>\n<td>\u8986\u76d6 .w-e-table \u6837\u5f0f&#xff0c;\u8bbe\u7f6e border-collapse<\/td>\n<\/tr>\n<tr>\n<td>\u521d\u59cb\u5316\u7a7a\u767d<\/td>\n<td>\u4f7f\u7528 setTimeout \u5ef6\u8fdf 100ms \u8bbe\u7f6e\u5185\u5bb9<\/td>\n<\/tr>\n<tr>\n<td>\u5185\u5b58\u6cc4\u6f0f<\/td>\n<td>\u52a1\u5fc5\u5728 onBeforeUnmount \u4e2d\u8c03\u7528 destroy()<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3>\u516d\u3001\u603b\u7ed3<\/h3>\n<p>\u901a\u8fc7\u672c\u6587\u7684 index.vue \u7ec4\u4ef6&#xff0c;\u6211\u4eec\u5b9e\u73b0\u4e86&#xff1a;<\/p>\n<ul>\n<li>\u2705 \u53cc\u5411\u7ed1\u5b9a\u5185\u5bb9<\/li>\n<li>\u2705 \u81ea\u5b9a\u4e49\u56fe\u7247\u4e0a\u4f20&#xff08;\u5e26 token&#xff09;<\/li>\n<li>\u2705 \u8868\u683c\u589e\u5f3a&#xff08;\u884c\u5217\u64cd\u4f5c\u3001\u6837\u5f0f\u7f8e\u5316&#xff09;<\/li>\n<li>\u2705 \u53ea\u8bfb\/\u7f16\u8f91\u6a21\u5f0f\u5207\u6362<\/li>\n<li>\u2705 \u5b89\u5168\u521d\u59cb\u5316\u4e0e\u9500\u6bc1<\/li>\n<\/ul>\n<p>WangEditor \u5728 Vue 3 \u4e2d\u7684\u96c6\u6210\u975e\u5e38\u53cb\u597d&#xff0c;\u914d\u5408 TypeScript \u548c Composition API&#xff0c;\u80fd\u6784\u5efa\u51fa\u7a33\u5b9a\u3001\u53ef\u7ef4\u62a4\u7684\u5bcc\u6587\u672c\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n<p>&#x1f517; \u5b98\u65b9\u6587\u6863&#xff1a;https:\/\/www.wangeditor.com\/<\/p>\n<hr \/>\n<p>\u6b22\u8fce\u70b9\u8d5e\u3001\u6536\u85cf\u3001\u8bc4\u8bba\u4ea4\u6d41&#xff01;\u5982\u6709\u7591\u95ee&#xff0c;\u53ef\u5728\u8bc4\u8bba\u533a\u7559\u8a00&#xff5e;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f9d\u8d56\u5305&#xff1a;wangeditor\/editor-for-vue5.1.12 \u5bcc\u6587\u672c\u7f16\u8f91\u5668\u662f\u73b0\u4ee3 Web \u5e94\u7528\u4e2d\u4e0d\u53ef\u6216\u7f3a\u7684\u7ec4\u4ef6&#xff0c;\u5c24\u5176\u5728 CMS\u3001\u535a\u5ba2\u3001\u540e\u53f0\u7ba1\u7406\u7cfb\u7edf\u7b49\u573a\u666f\u4e2d\u5e7f\u6cdb\u4f7f\u7528\u3002\u672c\u6587\u5c06\u5e26\u4f60\u4e00\u6b65\u6b65\u5728 Vue 3 \u9879\u76ee\u4e2d\u96c6\u6210 WangEditor&#xff08;\u56fd\u4ea7\u5f00\u6e90\u5bcc\u6587\u672c\u7f16\u8f91\u5668&#xff09;&#xff0c;\u5e76\u901a\u8fc7\u4e00\u4e2a\u5b8c\u6574\u7684 index.vue \u7ec4\u4ef6\u793a\u4f8b&#xff0c;\u8be6\u7ec6\u89e3\u6790\u5176\u914d\u7f6e\u9879\u3001\u4e8b\u4ef6\u5904\u7406\u3001\u56fe\u7247\u4e0a\u4f20\u3001\u8868\u683c\u652f\u6301\u53ca\u53ea\u8bfb\u6a21\u5f0f\u7b49\u9ad8\u7ea7\u529f\u80fd\u3002 \u4e00\u3001\u4e3a\u4ec0\u4e48\u9009\u62e9<\/p>\n","protected":false},"author":2,"featured_media":70337,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[187,625,87],"topic":[],"class_list":["post-70338","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-javascript","tag-vue-js","tag-87"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5728 Vue 3 \u4e2d\u96c6\u6210 WangEditor \u5bcc\u6587\u672c\u7f16\u8f91\u5668\uff1a\u4ece\u57fa\u7840\u5230\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/70338.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5728 Vue 3 \u4e2d\u96c6\u6210 WangEditor \u5bcc\u6587\u672c\u7f16\u8f91\u5668\uff1a\u4ece\u57fa\u7840\u5230\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4f9d\u8d56\u5305&#xff1a;wangeditor\/editor-for-vue5.1.12 \u5bcc\u6587\u672c\u7f16\u8f91\u5668\u662f\u73b0\u4ee3 Web \u5e94\u7528\u4e2d\u4e0d\u53ef\u6216\u7f3a\u7684\u7ec4\u4ef6&#xff0c;\u5c24\u5176\u5728 CMS\u3001\u535a\u5ba2\u3001\u540e\u53f0\u7ba1\u7406\u7cfb\u7edf\u7b49\u573a\u666f\u4e2d\u5e7f\u6cdb\u4f7f\u7528\u3002\u672c\u6587\u5c06\u5e26\u4f60\u4e00\u6b65\u6b65\u5728 Vue 3 \u9879\u76ee\u4e2d\u96c6\u6210 WangEditor&#xff08;\u56fd\u4ea7\u5f00\u6e90\u5bcc\u6587\u672c\u7f16\u8f91\u5668&#xff09;&#xff0c;\u5e76\u901a\u8fc7\u4e00\u4e2a\u5b8c\u6574\u7684 index.vue \u7ec4\u4ef6\u793a\u4f8b&#xff0c;\u8be6\u7ec6\u89e3\u6790\u5176\u914d\u7f6e\u9879\u3001\u4e8b\u4ef6\u5904\u7406\u3001\u56fe\u7247\u4e0a\u4f20\u3001\u8868\u683c\u652f\u6301\u53ca\u53ea\u8bfb\u6a21\u5f0f\u7b49\u9ad8\u7ea7\u529f\u80fd\u3002 \u4e00\u3001\u4e3a\u4ec0\u4e48\u9009\u62e9\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/70338.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-02-01T12:05:20+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260201120519-697f417f1618a.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/70338.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/70338.html\",\"name\":\"\u5728 Vue 3 \u4e2d\u96c6\u6210 WangEditor \u5bcc\u6587\u672c\u7f16\u8f91\u5668\uff1a\u4ece\u57fa\u7840\u5230\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-02-01T12:05:20+00:00\",\"dateModified\":\"2026-02-01T12:05:20+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/70338.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/70338.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/70338.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5728 Vue 3 \u4e2d\u96c6\u6210 WangEditor \u5bcc\u6587\u672c\u7f16\u8f91\u5668\uff1a\u4ece\u57fa\u7840\u5230\u5b9e\u6218\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5728 Vue 3 \u4e2d\u96c6\u6210 WangEditor \u5bcc\u6587\u672c\u7f16\u8f91\u5668\uff1a\u4ece\u57fa\u7840\u5230\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/70338.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5728 Vue 3 \u4e2d\u96c6\u6210 WangEditor \u5bcc\u6587\u672c\u7f16\u8f91\u5668\uff1a\u4ece\u57fa\u7840\u5230\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4f9d\u8d56\u5305&#xff1a;wangeditor\/editor-for-vue5.1.12 \u5bcc\u6587\u672c\u7f16\u8f91\u5668\u662f\u73b0\u4ee3 Web \u5e94\u7528\u4e2d\u4e0d\u53ef\u6216\u7f3a\u7684\u7ec4\u4ef6&#xff0c;\u5c24\u5176\u5728 CMS\u3001\u535a\u5ba2\u3001\u540e\u53f0\u7ba1\u7406\u7cfb\u7edf\u7b49\u573a\u666f\u4e2d\u5e7f\u6cdb\u4f7f\u7528\u3002\u672c\u6587\u5c06\u5e26\u4f60\u4e00\u6b65\u6b65\u5728 Vue 3 \u9879\u76ee\u4e2d\u96c6\u6210 WangEditor&#xff08;\u56fd\u4ea7\u5f00\u6e90\u5bcc\u6587\u672c\u7f16\u8f91\u5668&#xff09;&#xff0c;\u5e76\u901a\u8fc7\u4e00\u4e2a\u5b8c\u6574\u7684 index.vue \u7ec4\u4ef6\u793a\u4f8b&#xff0c;\u8be6\u7ec6\u89e3\u6790\u5176\u914d\u7f6e\u9879\u3001\u4e8b\u4ef6\u5904\u7406\u3001\u56fe\u7247\u4e0a\u4f20\u3001\u8868\u683c\u652f\u6301\u53ca\u53ea\u8bfb\u6a21\u5f0f\u7b49\u9ad8\u7ea7\u529f\u80fd\u3002 \u4e00\u3001\u4e3a\u4ec0\u4e48\u9009\u62e9","og_url":"https:\/\/www.wsisp.com\/helps\/70338.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-02-01T12:05:20+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260201120519-697f417f1618a.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/70338.html","url":"https:\/\/www.wsisp.com\/helps\/70338.html","name":"\u5728 Vue 3 \u4e2d\u96c6\u6210 WangEditor \u5bcc\u6587\u672c\u7f16\u8f91\u5668\uff1a\u4ece\u57fa\u7840\u5230\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-02-01T12:05:20+00:00","dateModified":"2026-02-01T12:05:20+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/70338.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/70338.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/70338.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5728 Vue 3 \u4e2d\u96c6\u6210 WangEditor \u5bcc\u6587\u672c\u7f16\u8f91\u5668\uff1a\u4ece\u57fa\u7840\u5230\u5b9e\u6218"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/70338","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=70338"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/70338\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/70337"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=70338"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=70338"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=70338"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=70338"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}