保存进度!
This commit is contained in:
commit
8b0f8e618b
|
@ -9,19 +9,19 @@
|
||||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
svg-icon:{{ this.iconName }}
|
svg-icon:{{ iconName }}
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: "svg-icon",
|
name: "SvgIcon",
|
||||||
|
props: ["icon",],
|
||||||
data()
|
data()
|
||||||
{
|
{
|
||||||
return {
|
return {
|
||||||
iconName: "",
|
iconName: "",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: ["icon",],
|
|
||||||
created()
|
created()
|
||||||
{
|
{
|
||||||
console.log("svg");
|
console.log("svg");
|
||||||
|
|
|
@ -8,15 +8,15 @@
|
||||||
*
|
*
|
||||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||||
*/
|
*/
|
||||||
import { createStore } from 'vuex';
|
import { createStore } from "vuex";
|
||||||
import app from "./modules/app";
|
import app from "./modules/app";
|
||||||
import requirement from "./modules/requirement";
|
import requirement from "./modules/requirement";
|
||||||
|
|
||||||
const store = createStore({
|
const store = createStore({
|
||||||
modules: {
|
modules: {
|
||||||
app,
|
app,
|
||||||
requirement,
|
requirement,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export default store;
|
export default store;
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: "NewsPage"
|
name: "NewsPage",
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -11,12 +11,17 @@
|
||||||
<template>
|
<template>
|
||||||
信息编辑:{{ getCount }}
|
信息编辑:{{ getCount }}
|
||||||
<br>
|
<br>
|
||||||
<el-button type="danger" @click="this.add">计数加一</el-button>
|
<el-button
|
||||||
<SvgIcon icon="house"></SvgIcon>
|
type="danger"
|
||||||
|
@click="add"
|
||||||
|
>
|
||||||
|
计数加一
|
||||||
|
</el-button>
|
||||||
|
<SvgIcon icon="house" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
//import { ElMessage } from 'element-plus';
|
// import { ElMessage } from 'element-plus';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "NewsEdit",
|
name: "NewsEdit",
|
||||||
|
@ -32,18 +37,18 @@ export default {
|
||||||
return this.$store.state.app.count;
|
return this.$store.state.app.count;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
created()
|
||||||
|
{
|
||||||
|
this.store = this.$store;
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
add()
|
add()
|
||||||
{
|
{
|
||||||
let count = this.store.state.app.count + 1;
|
const count = this.store.state.app.count + 1;
|
||||||
|
|
||||||
this.store.commit("app/SET_COUNT", count);
|
this.store.commit("app/SET_COUNT", count);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
created()
|
|
||||||
{
|
|
||||||
this.store = this.$store;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: "NewsPage"
|
name: "NewsPage",
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -8,60 +8,60 @@
|
||||||
*
|
*
|
||||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||||
*/
|
*/
|
||||||
import { defineConfig } from 'vite';
|
import { defineConfig } from "vite";
|
||||||
import path from 'path';
|
import path from "path";
|
||||||
import vue from '@vitejs/plugin-vue';
|
import vue from "@vitejs/plugin-vue";
|
||||||
import vueJsx from '@vitejs/plugin-vue-jsx';
|
import vueJsx from "@vitejs/plugin-vue-jsx";
|
||||||
import ViteRequireContext from '@originjs/vite-plugin-require-context';
|
import ViteRequireContext from "@originjs/vite-plugin-require-context";
|
||||||
import envCompatible from 'vite-plugin-env-compatible';
|
import envCompatible from "vite-plugin-env-compatible";
|
||||||
import { createHtmlPlugin } from 'vite-plugin-html';
|
import { createHtmlPlugin } from "vite-plugin-html";
|
||||||
import { viteCommonjs } from '@originjs/vite-plugin-commonjs';
|
import { viteCommonjs } from "@originjs/vite-plugin-commonjs";
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: [
|
alias: [
|
||||||
{
|
{
|
||||||
find: /^~/,
|
find: /^~/,
|
||||||
replacement: '',
|
replacement: "",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
find: '@',
|
find: "@",
|
||||||
replacement: path.resolve(__dirname, 'src'),
|
replacement: path.resolve(__dirname, "src"),
|
||||||
},
|
},
|
||||||
|
],
|
||||||
|
extensions: [
|
||||||
|
".mjs",
|
||||||
|
".js",
|
||||||
|
".ts",
|
||||||
|
".jsx",
|
||||||
|
".tsx",
|
||||||
|
".json",
|
||||||
|
".vue",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
vue(),
|
||||||
|
vueJsx(),
|
||||||
|
ViteRequireContext(),
|
||||||
|
viteCommonjs(),
|
||||||
|
envCompatible(),
|
||||||
|
createHtmlPlugin({
|
||||||
|
inject: {
|
||||||
|
data: {
|
||||||
|
title: "CPIC-IT-Console",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
extensions: [
|
base: "./",
|
||||||
'.mjs',
|
server: {
|
||||||
'.js',
|
strictPort: false,
|
||||||
'.ts',
|
port: 8001,
|
||||||
'.jsx',
|
host: "localhost",
|
||||||
'.tsx',
|
open: true,
|
||||||
'.json',
|
},
|
||||||
'.vue',
|
build: {
|
||||||
],
|
outDir: "dist",
|
||||||
},
|
},
|
||||||
plugins: [
|
|
||||||
vue(),
|
|
||||||
vueJsx(),
|
|
||||||
ViteRequireContext(),
|
|
||||||
viteCommonjs(),
|
|
||||||
envCompatible(),
|
|
||||||
createHtmlPlugin({
|
|
||||||
inject: {
|
|
||||||
data: {
|
|
||||||
title: 'CPIC-IT-Console',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
base: './',
|
|
||||||
server: {
|
|
||||||
strictPort: false,
|
|
||||||
port: 8001,
|
|
||||||
host: 'localhost',
|
|
||||||
open: true,
|
|
||||||
},
|
|
||||||
build: {
|
|
||||||
outDir: 'dist',
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -20,35 +20,35 @@
|
||||||
// }
|
// }
|
||||||
// );
|
// );
|
||||||
module.exports = {
|
module.exports = {
|
||||||
transpileDependencies: true,
|
transpileDependencies: true,
|
||||||
devServer: {
|
devServer: {
|
||||||
open: true,
|
open: true,
|
||||||
host: "localhost",
|
host: "localhost",
|
||||||
port: 8000,
|
port: 8000,
|
||||||
},
|
},
|
||||||
// chainWebpack: (config) =>
|
// chainWebpack: (config) =>
|
||||||
// {
|
// {
|
||||||
// // svg 图标解析
|
// // svg 图标解析
|
||||||
// const svgRule = config.module.rule("svg"); //默认规则赋给 subRule 变量
|
// const svgRule = config.module.rule("svg"); //默认规则赋给 subRule 变量
|
||||||
// svgRule.uses.clear(); // 清除已有的所有规则。
|
// svgRule.uses.clear(); // 清除已有的所有规则。
|
||||||
// svgRule // 添加要替换的规则
|
// svgRule // 添加要替换的规则
|
||||||
// .use("svg-sprite-loader")
|
// .use("svg-sprite-loader")
|
||||||
// .loader("svg-sprite-loader")
|
// .loader("svg-sprite-loader")
|
||||||
// .options({
|
// .options({
|
||||||
// symbolId: "icon-[name]",
|
// symbolId: "icon-[name]",
|
||||||
// include: ["./src/components/svg/icons",], // 特别注意的目录路径
|
// include: ["./src/components/svg/icons",], // 特别注意的目录路径
|
||||||
// });
|
// });
|
||||||
// 配置base64转换规则
|
// 配置base64转换规则
|
||||||
// config.module
|
// config.module
|
||||||
// .rule('images')
|
// .rule('images')
|
||||||
// .use('url-loader')
|
// .use('url-loader')
|
||||||
// .loader('url-loader')
|
// .loader('url-loader')
|
||||||
// .tap(options => Object.assign(options, { limit: 1 }));
|
// .tap(options => Object.assign(options, { limit: 1 }));
|
||||||
|
|
||||||
// 载入项目分析工具
|
// 载入项目分析工具
|
||||||
// config.plugin('webpack-bundle-analyzer').use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin)
|
// config.plugin('webpack-bundle-analyzer').use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin)
|
||||||
// },
|
// },
|
||||||
//打包输出目录
|
//打包输出目录
|
||||||
publicPath: "./",
|
publicPath: "./",
|
||||||
outputDir: "dist",
|
outputDir: "dist",
|
||||||
};
|
};
|
Loading…
Reference in New Issue