<template>
    <h1>学习vue表单程序</h1>
    <h1>{{id}}:{{name}}</h1>
    <form>
        学号:<input type="text" id = "id" name = "id" value="" v-model="id"><br>
        姓名:<input type="text" id="name" name="name" value="" v-model="name"><br>
        <input type="button" id="ok" name="ok" value="ok" @click="check">
    </form>
</template>

<script>
export default {
    name: "MyEdit_1",
    data(){
        return{
            id:"001",
            name:"Mike",
        }
    },
    methods:{
        check:function(){
            this.name="check ok";
        }
    },
    mounted() {
        //需要加载后自动执行的代码放到mounted
        window.setTimeout(
            this.check,
            2000
        )
    }

}
</script>

<style scoped>

</style>