vue-3 计算属性

<template>
  <div>   
      学校:<input type="text" placeholder="请输入学校" v-model="school" /><br />
      班级:<input type="text" placeholder="请输入班级" v-model="className" /><br />
      姓名:<input type="text" placeholder="请输入姓名" v-model="name" /><br />
      学生信息:<span>{{studentDetail}}</span>
  </div>
</template>
<script>
export default {
  name: "Address",
  data() {
    return {
      school: "",
      className: "",
      name: ""
    }
  },
  created() {
  },
  //计算属性
  computed: {

    studentDetail() {
      return this.school+this.className+this.name
    }
  }
}
</script>

 

posted @ 2022-10-08 18:04  怪圣卡杰  阅读(36)  评论(0编辑  收藏  举报