提交 bf23408a 编写于 作者: U ugyigg7

Thu Sep 14 16:18:00 CST 2023 inscode

上级 7a093d7e
run = "npm i && npm run dev" run = "npm i && npm run dev"
language = "node"
[deployment] [deployment]
build = "npm i && npm run build" build = "npm i && npm run build"
...@@ -8,3 +9,6 @@ run = "npm run preview" ...@@ -8,3 +9,6 @@ run = "npm run preview"
PATH = "/root/${PROJECT_DIR}/.config/npm/node_global/bin:/root/${PROJECT_DIR}/node_modules/.bin:${PATH}" PATH = "/root/${PROJECT_DIR}/.config/npm/node_global/bin:/root/${PROJECT_DIR}/node_modules/.bin:${PATH}"
XDG_CONFIG_HOME = "/root/.config" XDG_CONFIG_HOME = "/root/.config"
npm_config_prefix = "/root/${PROJECT_DIR}/.config/npm/node_global" npm_config_prefix = "/root/${PROJECT_DIR}/.config/npm/node_global"
[debugger]
program = "main.js"
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
}, },
"dependencies": { "dependencies": {
"guess": "^1.0.2", "guess": "^1.0.2",
"mitt": "^3.0.1",
"vue": "^3.2.37" "vue": "^3.2.37"
}, },
"devDependencies": { "devDependencies": {
......
//引入mitt
import mitt from "mitt";
// mitt库默认导出的是一个函数,我们需要执行它从而得到事件总线的对象
const mitter = mitt();
// 面向函数 定义app方便后期渐进式
const app = createApp(App);
app.use(store).use(router).mount("#app");
// 挂载到 app 上 后期可以使用$mitt
app.config.globalProperties.$mitt = mitter;
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册