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

47 lines
987 B
JavaScript

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