• vue.js表单提交


    <!DOCTYPE html> 
    <html lang="en"> 
        <head> 
            <meta charset="UTF-8"> 
            <title>helloform_Vue</title> 
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
            <script src="./vue.js"></script> 
        </head> 
        <body> 
        <div class="hello"> 
            <ul> 
                <form @submit.prevent="submit"> 
                    <input type="text" name="name" v-model="inputtext.name"> 
                    <input type="password" name="password" v-model="inputtext.password"> 
                    <input type="submit" value="提交"> 
                </form> 
            </ul> 
        </div> 
        <script> 
            var vm = new Vue({ 
                el: '.hello', 
                data: { 
                     
                    inputtext:{} 
                }, 
                methods: { 
                    submit: function() { 
                        console.log(this.inputtext); 
                    } 
                }, 
            }) 
        </script> 
     
        </body> 
    </html> 

  • 相关阅读:
    MkDocs: 构建你自己的知识库
    Vue入门
    Vue UI库
    【入门】PyTorch
    【转载】工业相机的原理与选型
    如果你是狮子,就得学会逼狼去吃草
    【转载】剖析Git的实现机制
    管理学-员工管理
    量化投资
    【汇总】图像格式
  • 原文地址:https://www.cnblogs.com/gerry/p/7717737.html
Copyright © 2020-2023  润新知