Files
vue3-learn/src/App.vue
T
2026-05-10 16:35:15 +08:00

30 lines
738 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<dev>
<p>姓名<input v-model="userName" /></p>
<p>薪水<input v-model="salary" /></p>
<button @click="zhanggongzi">涨工资</button>
<button @click="kougongzi"">扣工资</button>
</dev>
<hr />
<dev>
<p>姓名<input v-model="mySalary.userName" /></p>
<p>薪水<input v-model="mySalary.salary" /></p>
<button @click="mySalary.zhanggongzi">涨工资</button>
<button @click="mySalary.kougongzi">扣工资</button>
</dev>
</template>
<script setup lang="ts">
import { reactive } from 'vue'
import MySalary from '@/components/MySalary'
let {userName, salary, zhanggongzi, kougongzi} = MySalary()
const mySalary = reactive(MySalary())
</script>
<style scoped></style>