<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>
标签:school,vue,return,name,className,计算,studentDetail,属性 From: https://www.cnblogs.com/dwdw/p/16769786.html