diff --git a/20_脚手架/vue_code/12.src_todolist全局事件总线/App.vue b/20_脚手架/vue_code/12.src_todolist全局事件总线/App.vue new file mode 100644 index 0000000..8228789 --- /dev/null +++ b/20_脚手架/vue_code/12.src_todolist全局事件总线/App.vue @@ -0,0 +1,128 @@ + + + + + \ No newline at end of file diff --git a/20_脚手架/vue_code/12.src_todolist全局事件总线/assets/logo.png b/20_脚手架/vue_code/12.src_todolist全局事件总线/assets/logo.png new file mode 100644 index 0000000..f3d2503 Binary files /dev/null and b/20_脚手架/vue_code/12.src_todolist全局事件总线/assets/logo.png differ diff --git a/20_脚手架/vue_code/src/components/TodoBottom.vue b/20_脚手架/vue_code/12.src_todolist全局事件总线/components/TodoBottom.vue similarity index 100% rename from 20_脚手架/vue_code/src/components/TodoBottom.vue rename to 20_脚手架/vue_code/12.src_todolist全局事件总线/components/TodoBottom.vue diff --git a/20_脚手架/vue_code/src/components/TodoHeader.vue b/20_脚手架/vue_code/12.src_todolist全局事件总线/components/TodoHeader.vue similarity index 100% rename from 20_脚手架/vue_code/src/components/TodoHeader.vue rename to 20_脚手架/vue_code/12.src_todolist全局事件总线/components/TodoHeader.vue diff --git a/20_脚手架/vue_code/src/components/TodoItem.vue b/20_脚手架/vue_code/12.src_todolist全局事件总线/components/TodoItem.vue similarity index 100% rename from 20_脚手架/vue_code/src/components/TodoItem.vue rename to 20_脚手架/vue_code/12.src_todolist全局事件总线/components/TodoItem.vue diff --git a/20_脚手架/vue_code/src/components/TodoList.vue b/20_脚手架/vue_code/12.src_todolist全局事件总线/components/TodoList.vue similarity index 100% rename from 20_脚手架/vue_code/src/components/TodoList.vue rename to 20_脚手架/vue_code/12.src_todolist全局事件总线/components/TodoList.vue diff --git a/20_脚手架/vue_code/12.src_todolist全局事件总线/main.js b/20_脚手架/vue_code/12.src_todolist全局事件总线/main.js new file mode 100644 index 0000000..4d5e394 --- /dev/null +++ b/20_脚手架/vue_code/12.src_todolist全局事件总线/main.js @@ -0,0 +1,19 @@ +// 引入Vue +import Vue from "vue"; +// 引入App +import App from "./App"; + +// 设置Vue +Vue.config.productionTip = false + + +// 实例化Vue +new Vue({ + components: { + App + }, + render: h => h(App), + beforeCreate() { + Vue.prototype.$bus = this // 安装全局事件总线 + } +}).$mount('#app') diff --git a/20_脚手架/vue_code/src/App.vue b/20_脚手架/vue_code/src/App.vue index 8228789..c8d2876 100644 --- a/20_脚手架/vue_code/src/App.vue +++ b/20_脚手架/vue_code/src/App.vue @@ -1,128 +1,32 @@ \ No newline at end of file diff --git a/20_脚手架/vue_code/src/components/School.vue b/20_脚手架/vue_code/src/components/School.vue new file mode 100644 index 0000000..4a8cac6 --- /dev/null +++ b/20_脚手架/vue_code/src/components/School.vue @@ -0,0 +1,47 @@ + + + + + + diff --git a/20_脚手架/vue_code/src/components/Student.vue b/20_脚手架/vue_code/src/components/Student.vue new file mode 100644 index 0000000..51bd505 --- /dev/null +++ b/20_脚手架/vue_code/src/components/Student.vue @@ -0,0 +1,35 @@ + + + + + +