|
@@ -1,47 +1,82 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <h1>
|
|
|
APP
|
|
|
<Demo1 ref="aaa"></Demo1>
|
|
|
<Demo2 :age1="3"></Demo2>
|
|
|
<Demo3 @getName="getName1"></Demo3>
|
|
|
<Demo4></Demo4>
|
|
|
<Demo5></Demo5>
|
|
|
- </h1>
|
|
|
+ <Demo6>瑶一瑶</Demo6>
|
|
|
+ <Demo7>
|
|
|
+ <template v-slot:header>
|
|
|
+ <p>瑶一瑶</p>
|
|
|
+ </template>
|
|
|
+ <template #neck>
|
|
|
+ <h4>杨金刚</h4>
|
|
|
+ </template>
|
|
|
+ <template #default>
|
|
|
+ <h5>杨水珍</h5>
|
|
|
+ </template>
|
|
|
+ </Demo7>
|
|
|
+ <Demo8>
|
|
|
+ <template v-slot="data">
|
|
|
+ {{ data.obj1.address }}
|
|
|
+ </template>
|
|
|
+ </Demo8>
|
|
|
+ <Demo9 title="杨金刚">
|
|
|
+ <template v-slot:header>今天星期四</template>
|
|
|
+ <template v-slot:footer="data">
|
|
|
+ <ul>
|
|
|
+ <li v-for="(item,index) in data.holiday1" :key="index">
|
|
|
+ {{ item }}
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </template>
|
|
|
+ </Demo9>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import Demo1 from './components/Demo1.vue';
|
|
|
-import Demo2 from './components/Demo2.vue';
|
|
|
-import Demo3 from './components/Demo3.vue';
|
|
|
-import Demo4 from './components/Demo4.vue';
|
|
|
-import Demo5 from './components/Demo5.vue';
|
|
|
+import Demo1 from "./components/Demo1.vue";
|
|
|
+import Demo2 from "./components/Demo2.vue";
|
|
|
+import Demo3 from "./components/Demo3.vue";
|
|
|
+import Demo4 from "./components/Demo4.vue";
|
|
|
+import Demo5 from "./components/Demo5.vue";
|
|
|
+import Demo6 from "./components/Demo6.vue";
|
|
|
+import Demo7 from "./components/Demo7.vue";
|
|
|
+import Demo8 from "./components/Demo8.vue";
|
|
|
+import Demo9 from "./components/Demo9.vue";
|
|
|
export default {
|
|
|
components: {
|
|
|
Demo1,
|
|
|
Demo2,
|
|
|
Demo3,
|
|
|
Demo4,
|
|
|
- Demo5
|
|
|
+ Demo5,
|
|
|
+ Demo6,
|
|
|
+ Demo7,
|
|
|
+ Demo8,
|
|
|
+ Demo9
|
|
|
},
|
|
|
- methods:{
|
|
|
+ created() {
|
|
|
+ // this.showMain()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
getMain() {
|
|
|
- console.log("端午节")
|
|
|
+ console.log("端午节");
|
|
|
},
|
|
|
getName1(name) {
|
|
|
- console.log("你好" + name)
|
|
|
+ console.log("你好" + name);
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
// 绑定
|
|
|
// this.$refs.名字.$on('事件名称',触发的方法)
|
|
|
- this.$refs.aaa.$on('flower',this.getMain)
|
|
|
+ this.$refs.aaa.$on("flower", this.getMain);
|
|
|
// console.log(,'121')
|
|
|
}
|
|
|
-}
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style>
|
|
|
-
|
|
|
</style>
|