|
|
@@ -1,17 +1,21 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<h1 class="h-26 text-6xl">Custom</h1>
|
|
|
- <h3 class="h-16 text-4xl"></h3>
|
|
|
+ <h3 class="h-16 text-4xl">子组件给了我{{ flower }}朵花</h3>
|
|
|
<hr class="h-15" />
|
|
|
<hr class="h-15" />
|
|
|
<hr class="h-15" />
|
|
|
- <Child></Child>
|
|
|
+ <Child @send="addThing"></Child>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
import { ref, reactive } from "vue";
|
|
|
import Child from "./index.vue";
|
|
|
+let flower = ref<number>(0);
|
|
|
+const addThing = () => {
|
|
|
+ flower.value += 1;
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|