liuyinglong / verify

71 stars 17 forks source link

v-model绑定对象数据好像不行 #2

Closed shyoucc closed 6 years ago

shyoucc commented 7 years ago

v-verify="obj.gszch" v-model="obj.gszch"

liuyinglong commented 7 years ago
            <div class="input-box clearFix">
                <input type="text" class="phoneIcon fl" placeholder="手机号码" v-model="regInfo.phone" v-verify="regInfo.phone">
                <label class="fl"></label>
            </div>
new Vue({
    el: "#wrapper",
    data:{
        regInfo:{
            phone:"",
            code:"",
            pwd:""
        }
    },
    verify:{
        regInfo:{
            phone:[
                "required",
                "mobile"
            ],
            code:[
                "required"
            ]
        }
    },
    methods:{
        submit:function(){
            console.log(this.$verify.check())
        }
    }
});
shyoucc commented 7 years ago

嗯之后发现可以了,谢谢