diff --git a/20_脚手架/vue_code/22.插槽/2.src_具名插槽/App.vue b/20_脚手架/vue_code/22.插槽/2.src_具名插槽/App.vue new file mode 100644 index 0000000..8485441 --- /dev/null +++ b/20_脚手架/vue_code/22.插槽/2.src_具名插槽/App.vue @@ -0,0 +1,55 @@ + + + + + 获取更多信息 + + + + {{ value }} + + + 单机游戏 + 网络游戏 + + + + + + + 经典 + 热门 + 推荐 + + 欢迎观看 + + + + + + + + + diff --git a/20_脚手架/vue_code/22.插槽/2.src_具名插槽/assets/logo.png b/20_脚手架/vue_code/22.插槽/2.src_具名插槽/assets/logo.png new file mode 100644 index 0000000..f3d2503 Binary files /dev/null and b/20_脚手架/vue_code/22.插槽/2.src_具名插槽/assets/logo.png differ diff --git a/20_脚手架/vue_code/22.插槽/2.src_具名插槽/components/Category.vue b/20_脚手架/vue_code/22.插槽/2.src_具名插槽/components/Category.vue new file mode 100644 index 0000000..5d6557a --- /dev/null +++ b/20_脚手架/vue_code/22.插槽/2.src_具名插槽/components/Category.vue @@ -0,0 +1,32 @@ + + + {{ title }}分类 + slot默认值1 + slot默认值2 + + + + + + \ No newline at end of file diff --git a/20_脚手架/vue_code/22.插槽/2.src_具名插槽/main.js b/20_脚手架/vue_code/22.插槽/2.src_具名插槽/main.js new file mode 100644 index 0000000..967576e --- /dev/null +++ b/20_脚手架/vue_code/22.插槽/2.src_具名插槽/main.js @@ -0,0 +1,23 @@ +// 引入Vue +import Vue from "vue"; +// 引入App +import App from "./App"; +// 引入插件 +import vueResource from "vue-resource"; + +// 设置Vue +Vue.config.productionTip = false + +// 使用插件 +Vue.use(vueResource) + +// 实例化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 035934c..8485441 100644 --- a/20_脚手架/vue_code/src/App.vue +++ b/20_脚手架/vue_code/src/App.vue @@ -1,15 +1,29 @@ - + + 获取更多信息 - + {{ value }} + + 单机游戏 + 网络游戏 + - + + + + 经典 + 热门 + 推荐 + + 欢迎观看 + + @@ -31,8 +45,11 @@ export default { diff --git a/20_脚手架/vue_code/src/components/Category.vue b/20_脚手架/vue_code/src/components/Category.vue index 3f524ac..5d6557a 100644 --- a/20_脚手架/vue_code/src/components/Category.vue +++ b/20_脚手架/vue_code/src/components/Category.vue @@ -1,7 +1,8 @@ {{ title }}分类 - slot默认值 + slot默认值1 + slot默认值2