时间:2022-10-14 10:26:11 | 栏目:vue | 点击:次
<li v-for="(item, index) in studentlist" :key="index"> {{item.stu_name}}--{{item.stu_score}} </li> <td> <tr> <span id="student_name">学生姓名</span> <input type="text" v-model="student_name"> </tr> </td> <td> <tr> <span id="student_score">期末成绩</span> <input type="text" v-model="student_score"> </tr> </td>
实现:
export default { name: 'Index', data () { return { student_name: '', student_score: '', studentlist: [] } }, methods: { addstudent () { this.studentlist.push({ stu_name: this.student_name, stu_score: this.student_score }) console.log(this.studentlist) } } } </script>
var board = gameContent[0].board;