FranckFreiburger / vue3-sfc-loader

Single File Component loader for Vue2 and Vue3. Load .vue files directly from your HTML. No node.js environment, no build step.
MIT License
1.03k stars 116 forks source link

使用问题反馈 #188

Closed hzdjulytech closed 3 months ago

hzdjulytech commented 3 months ago
  <script type="importmap">
  {
    "imports": {
      "axios": "https://unpkg.com/axios@1.6.8/dist/esm/axios.js" ,
      "vue":"https://unpkg.com/vue@3.4.21/dist/vue.esm-browser.js",
      "vue-router":"https://unpkg.com/vue-router@4.3.0/dist/vue-router.esm-browser.js"
    }
  }
</script>

首选出问题的是 vue-router.esm-browser.js 中导入了@vue/devtools-api 添加了 "@vue/devtools-api":"https://unpkg.com/@vue/devtools-api@6.6.1/lib/esm/index.js" 或者将 相关文件复制到后端资源目录 image 这时候出现了第二个问题 相对路径错误 image image image

image

前端开发导入时 一般习惯省略后缀 或者 index.xx 这会导致相对路径错误 ,真实路径只有相关服务器知道 应该有个方式告诉 vue3-sfc-loader 其内部资源加载相对路径以什么为准

FranckFreiburger commented 3 months ago

please use English language only.

hzdjulytech commented 3 months ago

image

image