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>
创作不易,转摘请标明出处。如果有意一起探讨测试相关技能可加博主QQ 771268289 博主微信:ding17121598
本文来自博客园,作者:怪圣卡杰,转载请注明原文链接:https://www.cnblogs.com/dwdw/p/16769786.html