vue3+vite2+tinymce5+echarts5

1.下载 tinymce完整包放到public目录
2.下载中文语言包到tinymce/langs里

  1. await load("/tinymce/tinymce.min.js")引入

@/components/Tinymce/index.vue




@util/loadScript.js

const dynamicLoadScript = src => {
  return new Promise((resolve, reject) => {
    const existingScript = document.getElementById(src);
    if (existingScript) resolve();
    if (!existingScript) {
      const script = document.createElement("script");
      script.src = src;
      script.id = src;
      document.body.appendChild(script);
      script.onload = resolve;
      script.onerror = reject;
    }
  });
};

export default dynamicLoadScript;

使用




4.封装echarts组件
src/components/Echarts/index.vue





使用src/views/PageA.vue





你可能感兴趣的:(vue3+vite2+tinymce5+echarts5)