表单输入绑定

1.基础用法

v-model指令在表单元素上创建双向数据绑定

v-model会忽略表单元素的value, checked, selected的初始值,使用v-model绑定值
















var app = new Vue({
    el: "#app",
    data: {
        text: "",
        checked: true,
        checkboxes: [],
        radios: [],
        select: "",
        items: [{id: 1, name: "66"}, {id: 2, name: "77"}],
    }
});

2.绑定value






var app = new Vue({
    el: "#app",
    data: {
        toggle: "",
        a: "a",
        b: "b",
        select: "",
        items: [{id: 1, name: "66"}, {id: 2, name: "77"}]
    }
});

3.修饰符







你可能感兴趣的:(表单输入绑定)