2023年3月29日 加入方法形式
This commit is contained in:
parent
2f9f179e07
commit
5808eba02c
|
@ -1,15 +1,29 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<a-card>
|
||||||
{{ state }}
|
<div>
|
||||||
<a-button type="error" @click="() => state.count++">点击+1</a-button>
|
<h1>首页</h1>
|
||||||
<a-button type="error" @click="() => i++">点击+1</a-button>
|
</div>
|
||||||
|
<div>
|
||||||
<RouterLink to="/site/index2">跳转到子页</RouterLink>
|
{{ state }}
|
||||||
</div>
|
<a-button type="primary" @click="() => state.count++">点击+1</a-button>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
{{ i }}
|
||||||
|
<a-button type="primary" @click="changeClick">点击+1</a-button>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<RouterLink to="/site/index2">跳转到子页</RouterLink>
|
||||||
|
</div>
|
||||||
|
</a-card>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
|
// reactive
|
||||||
const state = ref({ count: 0 });
|
const state = ref({ count: 0 });
|
||||||
const i = ref(1);
|
let i = ref(1);
|
||||||
|
|
||||||
|
function changeClick() {
|
||||||
|
i.value++;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue