diff --git a/20_脚手架/vue_code/09.自定义事件/App.vue b/20_脚手架/vue_code/09.src_自定义事件/App.vue similarity index 100% rename from 20_脚手架/vue_code/09.自定义事件/App.vue rename to 20_脚手架/vue_code/09.src_自定义事件/App.vue diff --git a/20_脚手架/vue_code/09.自定义事件/assets/logo.png b/20_脚手架/vue_code/09.src_自定义事件/assets/logo.png similarity index 100% rename from 20_脚手架/vue_code/09.自定义事件/assets/logo.png rename to 20_脚手架/vue_code/09.src_自定义事件/assets/logo.png diff --git a/20_脚手架/vue_code/09.自定义事件/components/School.vue b/20_脚手架/vue_code/09.src_自定义事件/components/School.vue similarity index 100% rename from 20_脚手架/vue_code/09.自定义事件/components/School.vue rename to 20_脚手架/vue_code/09.src_自定义事件/components/School.vue diff --git a/20_脚手架/vue_code/09.自定义事件/components/Student.vue b/20_脚手架/vue_code/09.src_自定义事件/components/Student.vue similarity index 100% rename from 20_脚手架/vue_code/09.自定义事件/components/Student.vue rename to 20_脚手架/vue_code/09.src_自定义事件/components/Student.vue diff --git a/20_脚手架/vue_code/09.自定义事件/main.js b/20_脚手架/vue_code/09.src_自定义事件/main.js similarity index 100% rename from 20_脚手架/vue_code/09.自定义事件/main.js rename to 20_脚手架/vue_code/09.src_自定义事件/main.js diff --git a/20_脚手架/vue_code/13.src_订阅事件_pubsub/App.vue b/20_脚手架/vue_code/13.src_订阅事件_pubsub/App.vue new file mode 100644 index 0000000..c8d2876 --- /dev/null +++ b/20_脚手架/vue_code/13.src_订阅事件_pubsub/App.vue @@ -0,0 +1,32 @@ + + + + + \ No newline at end of file diff --git a/20_脚手架/vue_code/13.src_订阅事件_pubsub/assets/logo.png b/20_脚手架/vue_code/13.src_订阅事件_pubsub/assets/logo.png new file mode 100644 index 0000000..f3d2503 Binary files /dev/null and b/20_脚手架/vue_code/13.src_订阅事件_pubsub/assets/logo.png differ diff --git a/20_脚手架/vue_code/src/components/School.vue b/20_脚手架/vue_code/13.src_订阅事件_pubsub/components/School.vue similarity index 100% rename from 20_脚手架/vue_code/src/components/School.vue rename to 20_脚手架/vue_code/13.src_订阅事件_pubsub/components/School.vue diff --git a/20_脚手架/vue_code/src/components/Student.vue b/20_脚手架/vue_code/13.src_订阅事件_pubsub/components/Student.vue similarity index 100% rename from 20_脚手架/vue_code/src/components/Student.vue rename to 20_脚手架/vue_code/13.src_订阅事件_pubsub/components/Student.vue diff --git a/20_脚手架/vue_code/13.src_订阅事件_pubsub/main.js b/20_脚手架/vue_code/13.src_订阅事件_pubsub/main.js new file mode 100644 index 0000000..4d5e394 --- /dev/null +++ b/20_脚手架/vue_code/13.src_订阅事件_pubsub/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/14.src_todolist订阅事件/App.vue b/20_脚手架/vue_code/14.src_todolist订阅事件/App.vue new file mode 100644 index 0000000..2bdf923 --- /dev/null +++ b/20_脚手架/vue_code/14.src_todolist订阅事件/App.vue @@ -0,0 +1,131 @@ + + + + + \ No newline at end of file diff --git a/20_脚手架/vue_code/14.src_todolist订阅事件/assets/logo.png b/20_脚手架/vue_code/14.src_todolist订阅事件/assets/logo.png new file mode 100644 index 0000000..f3d2503 Binary files /dev/null and b/20_脚手架/vue_code/14.src_todolist订阅事件/assets/logo.png differ diff --git a/20_脚手架/vue_code/14.src_todolist订阅事件/components/TodoBottom.vue b/20_脚手架/vue_code/14.src_todolist订阅事件/components/TodoBottom.vue new file mode 100644 index 0000000..b4de571 --- /dev/null +++ b/20_脚手架/vue_code/14.src_todolist订阅事件/components/TodoBottom.vue @@ -0,0 +1,76 @@ + + + + + \ No newline at end of file diff --git a/20_脚手架/vue_code/14.src_todolist订阅事件/components/TodoHeader.vue b/20_脚手架/vue_code/14.src_todolist订阅事件/components/TodoHeader.vue new file mode 100644 index 0000000..d4a857c --- /dev/null +++ b/20_脚手架/vue_code/14.src_todolist订阅事件/components/TodoHeader.vue @@ -0,0 +1,49 @@ + + + + + \ No newline at end of file diff --git a/20_脚手架/vue_code/14.src_todolist订阅事件/components/TodoItem.vue b/20_脚手架/vue_code/14.src_todolist订阅事件/components/TodoItem.vue new file mode 100644 index 0000000..8aa3ac4 --- /dev/null +++ b/20_脚手架/vue_code/14.src_todolist订阅事件/components/TodoItem.vue @@ -0,0 +1,75 @@ + + + + + \ No newline at end of file diff --git a/20_脚手架/vue_code/14.src_todolist订阅事件/components/TodoList.vue b/20_脚手架/vue_code/14.src_todolist订阅事件/components/TodoList.vue new file mode 100644 index 0000000..4be4cc2 --- /dev/null +++ b/20_脚手架/vue_code/14.src_todolist订阅事件/components/TodoList.vue @@ -0,0 +1,38 @@ + + + + + \ No newline at end of file diff --git a/20_脚手架/vue_code/14.src_todolist订阅事件/main.js b/20_脚手架/vue_code/14.src_todolist订阅事件/main.js new file mode 100644 index 0000000..4d5e394 --- /dev/null +++ b/20_脚手架/vue_code/14.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/package-lock.json b/20_脚手架/vue_code/package-lock.json index 2ba2270..d6b8488 100644 --- a/20_脚手架/vue_code/package-lock.json +++ b/20_脚手架/vue_code/package-lock.json @@ -9,6 +9,7 @@ "version": "0.1.0", "dependencies": { "core-js": "^3.8.3", + "pubsub-js": "^1.9.4", "vue": "^2.6.14" }, "devDependencies": { @@ -8553,6 +8554,11 @@ "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==", "dev": true }, + "node_modules/pubsub-js": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/pubsub-js/-/pubsub-js-1.9.4.tgz", + "integrity": "sha512-hJYpaDvPH4w8ZX/0Fdf9ma1AwRgU353GfbaVfPjfJQf1KxZ2iHaHl3fAUw1qlJIR5dr4F3RzjGaWohYUEyoh7A==" + }, "node_modules/pump": { "version": "3.0.0", "resolved": "https://registry.npmmirror.com/pump/-/pump-3.0.0.tgz", @@ -17480,6 +17486,11 @@ "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==", "dev": true }, + "pubsub-js": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/pubsub-js/-/pubsub-js-1.9.4.tgz", + "integrity": "sha512-hJYpaDvPH4w8ZX/0Fdf9ma1AwRgU353GfbaVfPjfJQf1KxZ2iHaHl3fAUw1qlJIR5dr4F3RzjGaWohYUEyoh7A==" + }, "pump": { "version": "3.0.0", "resolved": "https://registry.npmmirror.com/pump/-/pump-3.0.0.tgz", diff --git a/20_脚手架/vue_code/package.json b/20_脚手架/vue_code/package.json index 24398f5..5502076 100644 --- a/20_脚手架/vue_code/package.json +++ b/20_脚手架/vue_code/package.json @@ -9,6 +9,7 @@ }, "dependencies": { "core-js": "^3.8.3", + "pubsub-js": "^1.9.4", "vue": "^2.6.14" }, "devDependencies": { diff --git a/20_脚手架/vue_code/src/App.vue b/20_脚手架/vue_code/src/App.vue index c8d2876..2bdf923 100644 --- a/20_脚手架/vue_code/src/App.vue +++ b/20_脚手架/vue_code/src/App.vue @@ -1,32 +1,131 @@ \ No newline at end of file diff --git a/20_脚手架/vue_code/src/components/TodoBottom.vue b/20_脚手架/vue_code/src/components/TodoBottom.vue new file mode 100644 index 0000000..b4de571 --- /dev/null +++ b/20_脚手架/vue_code/src/components/TodoBottom.vue @@ -0,0 +1,76 @@ + + + + + \ No newline at end of file diff --git a/20_脚手架/vue_code/src/components/TodoHeader.vue b/20_脚手架/vue_code/src/components/TodoHeader.vue new file mode 100644 index 0000000..d4a857c --- /dev/null +++ b/20_脚手架/vue_code/src/components/TodoHeader.vue @@ -0,0 +1,49 @@ + + + + + \ No newline at end of file diff --git a/20_脚手架/vue_code/src/components/TodoItem.vue b/20_脚手架/vue_code/src/components/TodoItem.vue new file mode 100644 index 0000000..8aa3ac4 --- /dev/null +++ b/20_脚手架/vue_code/src/components/TodoItem.vue @@ -0,0 +1,75 @@ + + + + + \ No newline at end of file diff --git a/20_脚手架/vue_code/src/components/TodoList.vue b/20_脚手架/vue_code/src/components/TodoList.vue new file mode 100644 index 0000000..4be4cc2 --- /dev/null +++ b/20_脚手架/vue_code/src/components/TodoList.vue @@ -0,0 +1,38 @@ + + + + + \ No newline at end of file