You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

28 lines
432 B

<template>
<h1>个人信息</h1>
<h2>姓名{{name}}</h2>
<h2>年龄{{age}}</h2>
<button @click="sayHello">点击</button>
</template>
<script>
export default {
name: 'App',
setup() {
// 数据
let name = '张三'
let age = 19
// 方法
function sayHello() {
alert(`名字:${name},年龄:${age}`)
}
return {
name,
age,
sayHello,
}
}
}
</script>