|
@@ -1,11 +1,28 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div>
|
|
<div>
|
|
|
- <h1>Custom</h1>
|
|
|
|
|
|
|
+ <h1 class="h-26 text-6xl">Custom</h1>
|
|
|
|
|
+ <h3 class="h-16 text-4xl">孩子给了我{{ num }}瓶酒</h3>
|
|
|
|
|
+ <h3 class="h-16 text-4xl"></h3>
|
|
|
|
|
+ <hr class="h-15" />
|
|
|
|
|
+ <hr class="h-15" />
|
|
|
|
|
+ <hr class="h-15" />
|
|
|
|
|
+ <!--
|
|
|
|
|
+ 自定义事件:
|
|
|
|
|
+ 子 -> 父
|
|
|
|
|
+ 父组件中定义:事件的名称是任意的
|
|
|
|
|
+ 子组件中接受:需要通过defineEmits接受 进行触发
|
|
|
|
|
+ -->
|
|
|
|
|
+ <Child @send-wine="getWine"></Child>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
import { ref, reactive } from "vue";
|
|
import { ref, reactive } from "vue";
|
|
|
|
|
+import Child from "./index.vue";
|
|
|
|
|
+let num = ref(0);
|
|
|
|
|
+const getWine = () => {
|
|
|
|
|
+ num.value += 1;
|
|
|
|
|
+};
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|