0

我的js中有以下内容...

import Vue from 'https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.esm.browser.js';
import {createRouter, createWebHashHistory} from 'https://unpkg.com/browse/vue-router@3.5.2/dist/vue-router.esm.js';
const router = createRouter({
    history: createWebHashHistory(),
    routes
});

但是当我跑步时,我得到...

Loading module from “https://unpkg.com/browse/vue-router@3.5.2/dist/vue-router.esm.js” was blocked because of a disallowed MIME type (“text/html”).
localhost:5000
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://unpkg.com/browse/vue-router@3.5.2/dist/vue-router.esm.js. (Reason: CORS request did not succeed).

由于那来自 unpkg 我不确定如何更改 Mime 类型或 CORS 标头。

4

0 回答 0