vue-learning/入门/cli/hello-cli/src/main.js

47 lines
987 B
JavaScript
Raw Normal View History

2022-11-29 06:29:26 +00:00
/*
* @Author: Kane
* @Date: 2022-11-22 17:50:49
* @LastEditors: Kane
2022-12-04 17:07:26 +00:00
* @LastEditTime: 2022-12-05 01:05:43
2022-11-29 06:29:26 +00:00
* @FilePath: \hello-cli\src\main.js
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
import { createApp } from 'vue';
2022-11-29 07:29:41 +00:00
import { createStore } from "vuex";
2022-11-29 06:29:26 +00:00
import App from './App.vue';
import ElementPlus from "element-plus";
2022-12-04 16:23:26 +00:00
import "./assets/css/root.css";
import "./assets/css/normalize.css";
import "./assets/css/global.css";
2022-12-04 17:07:26 +00:00
import "./assets/css/colors.css";
2022-11-29 06:29:26 +00:00
import 'element-plus/dist/index.css';
2022-12-04 16:23:26 +00:00
2022-11-29 06:29:26 +00:00
const app = createApp(App);
2022-11-29 07:29:41 +00:00
const vuex = createStore({
state() {
return {
count: 0,
};
},
mutations: {
increment(state) {
state.count++;
2022-11-29 12:23:35 +00:00
},
clearCount(state) {
state.count = 0;
2022-11-29 07:29:41 +00:00
}
2022-11-29 12:23:35 +00:00
},
getters: {
countText(store) {
return store.count + "次";
},
},
2022-11-29 07:29:41 +00:00
});
app.use(vuex);
2022-11-29 06:29:26 +00:00
app.use(ElementPlus);
app.mount('#app');
2022-11-22 09:57:20 +00:00