diff --git a/20_脚手架/vue_code/5.src_scoped样式/App.vue b/20_脚手架/vue_code/5.src_scoped样式/App.vue new file mode 100644 index 0000000..6da73f6 --- /dev/null +++ b/20_脚手架/vue_code/5.src_scoped样式/App.vue @@ -0,0 +1,25 @@ + + + + + \ No newline at end of file diff --git a/20_脚手架/vue_code/5.src_scoped样式/assets/logo.png b/20_脚手架/vue_code/5.src_scoped样式/assets/logo.png new file mode 100644 index 0000000..f3d2503 Binary files /dev/null and b/20_脚手架/vue_code/5.src_scoped样式/assets/logo.png differ diff --git a/20_脚手架/vue_code/5.src_scoped样式/components/School.vue b/20_脚手架/vue_code/5.src_scoped样式/components/School.vue new file mode 100644 index 0000000..ba5c795 --- /dev/null +++ b/20_脚手架/vue_code/5.src_scoped样式/components/School.vue @@ -0,0 +1,27 @@ + + + + + + diff --git a/20_脚手架/vue_code/5.src_scoped样式/components/Student.vue b/20_脚手架/vue_code/5.src_scoped样式/components/Student.vue new file mode 100644 index 0000000..346047f --- /dev/null +++ b/20_脚手架/vue_code/5.src_scoped样式/components/Student.vue @@ -0,0 +1,26 @@ + + + + + + diff --git a/20_脚手架/vue_code/5.src_scoped样式/main.js b/20_脚手架/vue_code/5.src_scoped样式/main.js new file mode 100644 index 0000000..30ef712 --- /dev/null +++ b/20_脚手架/vue_code/5.src_scoped样式/main.js @@ -0,0 +1,16 @@ +// 引入Vue +import Vue from "vue"; +// 引入App +import App from "./App"; + +// 设置Vue +Vue.config.productionTip = false + + +// 实例化Vue +new Vue({ + components: { + App + }, + render: h => h(App) +}).$mount('#app') diff --git a/20_脚手架/vue_code/src/App.vue b/20_脚手架/vue_code/src/App.vue index 197be06..6da73f6 100644 --- a/20_脚手架/vue_code/src/App.vue +++ b/20_脚手架/vue_code/src/App.vue @@ -16,4 +16,10 @@ export default { Student } } - \ No newline at end of file + + + \ No newline at end of file diff --git a/20_脚手架/vue_code/src/components/School.vue b/20_脚手架/vue_code/src/components/School.vue index f8487cb..ba5c795 100644 --- a/20_脚手架/vue_code/src/components/School.vue +++ b/20_脚手架/vue_code/src/components/School.vue @@ -1,8 +1,7 @@ @@ -12,16 +11,17 @@ export default { name: "School", data() { return { - name: "修仙学院修仙学院修仙学院", + name: "修仙学院", address: "长白山", msg: "欢迎学校" // 以vc内数据为准 } }, - methods: { - test() { - this.hello() - } - } } + + diff --git a/20_脚手架/vue_code/src/components/Student.vue b/20_脚手架/vue_code/src/components/Student.vue index 5c9795f..346047f 100644 --- a/20_脚手架/vue_code/src/components/Student.vue +++ b/20_脚手架/vue_code/src/components/Student.vue @@ -1,8 +1,7 @@ @@ -19,3 +18,9 @@ export default { } + + diff --git a/20_脚手架/vue_code/src/main.js b/20_脚手架/vue_code/src/main.js index 9b213cd..30ef712 100644 --- a/20_脚手架/vue_code/src/main.js +++ b/20_脚手架/vue_code/src/main.js @@ -2,14 +2,10 @@ import Vue from "vue"; // 引入App import App from "./App"; -// 引入插件 -import plugins from "./plugins" // 设置Vue Vue.config.productionTip = false -// 使用插件 -Vue.use(plugins) // 实例化Vue new Vue({ diff --git a/20_脚手架/vue_code/src/plugins.js b/20_脚手架/vue_code/src/plugins.js deleted file mode 100644 index ab8d224..0000000 --- a/20_脚手架/vue_code/src/plugins.js +++ /dev/null @@ -1,34 +0,0 @@ -export default { - install(Vue) { - // 全局过滤器 - Vue.filter("mySlice", function (value) { - return value.slice(0, 4) - }) - - // 全局指令 - Vue.directive("fbind", { - bind(element, binding) { - element.value = binding.value - }, - inserted(element, binding) { - element.focus() - }, - update(element, binding) { - element.value = binding.value - } - }) - - // 定义混入 - Vue.mixin({ - data() { - return { - x: 100, - y: 200 - } - } - }) - - // 给Vue原型上添加一个方法 - Vue.prototype.hello = ()=> {alert('Hello')} - } -} \ No newline at end of file