<!DOCTYPE html>
<html> <head> <meta charset="utf-8"> <title>Vue 测试实例 - 菜鸟教程(runoob.com)</title> <script src="https://cdn.bootcss.com/vue/2.4.2/vue.min.js"></script> </head> <body> <div id="app"> <p>选中的值{{ person.type }}</p> <label for='student'>学生<input id='student' value='0' v-model="person.type" type='radio'/></label> <label for='tearch'>教师<input id='tearch' value='1' v-model='person.type' type='radio'/></label> </div>
<script> new Vue({ el: '#app', data: { person:{ type:0 } } }) </script>
</body> </html>