|
@@ -1,16 +1,21 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div>
|
|
<div>
|
|
|
<h1 class="h-26 text-6xl">Attrs</h1>
|
|
<h1 class="h-26 text-6xl">Attrs</h1>
|
|
|
- <h3 class="h-16 text-4xl"></h3>
|
|
|
|
|
|
|
+ <h3 class="h-16 text-4xl">我有{{ car }}辆车</h3>
|
|
|
<h3 class="h-16 text-4xl"></h3>
|
|
<h3 class="h-16 text-4xl"></h3>
|
|
|
<hr class="h-15" />
|
|
<hr class="h-15" />
|
|
|
<hr class="h-15" />
|
|
<hr class="h-15" />
|
|
|
- <Child></Child>
|
|
|
|
|
|
|
+ <Child :carNum="car / 2" @back="changeCar"></Child>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
|
|
+import { ref, reactive } from "vue";
|
|
|
import Child from "./Child.vue";
|
|
import Child from "./Child.vue";
|
|
|
|
|
+let car = ref(10);
|
|
|
|
|
+function changeCar(val) {
|
|
|
|
|
+ car.value += val;
|
|
|
|
|
+}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|