Commit 1e3e159e by caoyanzhi

update: gic-cli

parent 790989aa
# we recommend you to keep these unchanged
[*]
# 缩进样式=空格
indent_style = space
# 缩进大小=2
indent_size = 2
# 字符集=utf-8
charset = utf-8
# 删除行尾空格 = 是
trim_trailing_whitespace = true
# 插入最后一行=真
insert_final_newline = true
[*.md]
# 删除行尾空格 = 否
trim_trailing_whitespace = false
...@@ -4,15 +4,17 @@ module.exports = { ...@@ -4,15 +4,17 @@ module.exports = {
node: true, node: true,
}, },
extends: [ extends: [
"plugin:vue/essential", 'plugin:vue/essential',
"eslint:recommended", 'eslint:recommended',
"plugin:prettier/recommended", 'plugin:prettier/recommended',
], ],
parserOptions: { parserOptions: {
parser: "@babel/eslint-parser", parser: '@babel/eslint-parser',
}, },
rules: { rules: {
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off", 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off", 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'linebreak-style': 'off',
'prettier/prettier': ['error', { singleQuote: true }],
}, },
}; };
module.exports = { module.exports = {
presets: ["@vue/cli-plugin-babel/preset"], presets: ['@vue/cli-plugin-babel/preset'],
}; };
...@@ -7,9 +7,9 @@ ...@@ -7,9 +7,9 @@
</template> </template>
<script> <script>
import { projectName } from "@/config/index.js"; import { projectName } from '@/config/index.js';
export default { export default {
name: "App", name: 'App',
data() { data() {
return { return {
projectName, projectName,
...@@ -29,7 +29,7 @@ export default { ...@@ -29,7 +29,7 @@ export default {
const isKeepAlive = to.meta.fromPath.some((el) => { const isKeepAlive = to.meta.fromPath.some((el) => {
let menuUrlReg = el; let menuUrlReg = el;
let pathConfigReg = /(:.*)(\/?)/; let pathConfigReg = /(:.*)(\/?)/;
const pathRegStr = "([\\-]*[\\d\\w]+[\\-]*[\\d\\w]*)"; const pathRegStr = '([\\-]*[\\d\\w]+[\\-]*[\\d\\w]*)';
while (pathConfigReg.test(menuUrlReg)) { while (pathConfigReg.test(menuUrlReg)) {
menuUrlReg = menuUrlReg.replace(pathConfigReg, `${pathRegStr}$2`); menuUrlReg = menuUrlReg.replace(pathConfigReg, `${pathRegStr}$2`);
} }
......
export const projectName = "gic-web"; export const projectName = 'gic-web';
module.exports = { module.exports = {
publicPath: "/gic-web", publicPath: '/gic-web',
}; };
import Vue from "vue"; import Vue from 'vue';
import axios from "axios"; import axios from 'axios';
import App from "./App.vue"; import App from './App.vue';
import router from "./router"; import router from './router';
import store from "./store"; import store from './store';
axios.defaults.withCredentials = true; axios.defaults.withCredentials = true;
Vue.config.productionTip = false; Vue.config.productionTip = false;
Vue.prototype.axios = axios; Vue.prototype.axios = axios;
const abc = {
cbc: 'cbc',
};
console.log(abc);
window.getLimit(router, "gic-cli").then(() => { window.getLimit(router, 'gic-cli').then(() => {
new Vue({ new Vue({
router, router,
store, store,
render: (h) => h(App), render: (h) => h(App),
}).$mount("#app"); }).$mount('#app');
}); });
import Vue from "vue"; import Vue from 'vue';
import VueRouter from "vue-router"; import VueRouter from 'vue-router';
import HomeView from "../views/HomeView.vue"; import HomeView from '../views/HomeView.vue';
Vue.use(VueRouter); Vue.use(VueRouter);
const routes = [ const routes = [
{ {
path: "/", path: '/',
name: "home", name: 'home',
component: HomeView, component: HomeView,
}, },
{ {
path: "/about", path: '/about',
name: "about", name: 'about',
// route level code-splitting // route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route // this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited. // which is lazy-loaded when the route is visited.
component: () => component: () =>
import(/* webpackChunkName: "about" */ "../views/AboutView.vue"), import(/* webpackChunkName: "about" */ '../views/AboutView.vue'),
}, },
]; ];
......
import Vue from "vue"; import Vue from 'vue';
import Vuex from "vuex"; import Vuex from 'vuex';
Vue.use(Vuex); Vue.use(Vuex);
......
const { defineConfig } = require("@vue/cli-service"); const { defineConfig } = require('@vue/cli-service');
const { publicPath } = require("./src/config/public-path.js"); const { publicPath } = require('./src/config/public-path.js');
const path = require("path"); const path = require('path');
module.exports = defineConfig({ module.exports = defineConfig({
transpileDependencies: true, transpileDependencies: true,
configureWebpack: (config) => { configureWebpack: (config) => {
config.resolve.alias = { config.resolve.alias = {
"@": path.resolve(__dirname, "./src"), '@': path.resolve(__dirname, './src'),
}; };
config.externals = { config.externals = {
vue: "Vue", vue: 'Vue',
axios: "axios", axios: 'axios',
vuex: "Vuex", vuex: 'Vuex',
"vue-router": "VueRouter", 'vue-router': 'VueRouter',
"element-ui": "ELEMENT", 'element-ui': 'ELEMENT',
}; };
}, },
css: { css: {
...@@ -28,7 +28,7 @@ module.exports = defineConfig({ ...@@ -28,7 +28,7 @@ module.exports = defineConfig({
// 本地运行配置,及反向代理配置 // 本地运行配置,及反向代理配置
devServer: { devServer: {
port: 8080, port: 8080,
host: "localhost", host: 'localhost',
// https: false, // https: false,
// open: true, // 在服务器启动时自动在浏览器中打开应用程序 // open: true, // 在服务器启动时自动在浏览器中打开应用程序
// static: { // static: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment