Sco*_*ker 5 .net-core asp.net-core babel-polyfill vuetify.js asp.net-core-mvc-2.0
我正在尝试vuetify/lib使用通常的方法进行引用import Vuetify from "vuetify/lib",但是当我这样做时,该应用程序在IE11中由于阻塞了SCRIPT1003: Expected ':'。
如果我将引用更改为import Vuetify from "vuetify"-没有/lib部分-它不会引发错误。
请注意,我实际上尚未在任何地方使用 vuetify。我没有一个Vuetify组件或电话;我只是添加库。
现在,表面上看,IE11包含了vuetify并愉快地对其进行了解析,我想使用一些组件。如果我在模板中放置了任何 vuetify组件,则IE11会抛出一条Script1002: Syntax Error消息。
任何人都有建议使它真正起作用吗?
Index.cshtml
<v-app>
<div id="reportApp"></div>
</v-app>
Run Code Online (Sandbox Code Playgroud)
入口点
// polyfills
import "core-js/stable";
import "regenerator-runtime/runtime";
import Vue from "vue"
import "@mdi/font/css/materialdesignicons.css"
import reportFilter from "./reportFilter.vue"
const options = {
el: "#reportApp",
render: h => h(reportFilter)
};
export default new Vue(options);
Run Code Online (Sandbox Code Playgroud)
reportFilter.vue
<template>
<div>
<!-- this will throw a syntax error -->
<v-progress-circular indeterminate color="primary"
></v-progress-circular>
</div>
</template>
<script>
import axios from 'axios'
export default {
name: 'report-filter',
data: function(){
return {
dataTypeList: [
{ value: "1", text: "one" },
{ value: "2", text: "two" },
{ value: "3", text: "three" }
]
}
},
}
</script>
Run Code Online (Sandbox Code Playgroud)
webpack.config.js
const path = require("path");
const fs = require("fs");
const { VueLoaderPlugin } = require("vue-loader");
const VuetifyLoaderPlugin = require("vuetify-loader/lib/plugin");
module.exports = {
entry: jsEntries, // setting jsEntries removed for clarity
mode: "development",
module: {
rules: [
// other rules for css/sass/etc removed for clarity
/*javascript*/{
test: /\.m?js$/,
exclude: [
/node_modules/,
/bower_components/
],
use: {
loader: "babel-loader",
options: {
presets: [
[
"@babel/preset-env",
{
"targets": {
"browsers": [
"last 2 versions",
"ie >= 11"
]
},
"corejs": "3",
"useBuiltIns": "entry"
}
]
]
}
}
},
/*vue*/{
test: /\.vue$/i,
use: "vue-loader"
}
]
},
output: {
filename: "[name].js",
path: path.resolve(__dirname, "./wwwroot/dist/js/"),
publicPath: "/wwwroot/dist/js/"
},
plugins: [
new VueLoaderPlugin(),
new VuetifyLoaderPlugin()
],
resolve: {
alias: {
vue: "vue/dist/vue.js"
}
}
};
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
261 次 |
| 最近记录: |