vue将数据绑定到属性中

*必须使用[]

<tr v-for="(p,index) in prodects">
        @*v-bind:class="styleType(index)"*@
    <td v-for="(value,key) in p">{{value}}</td>
    <td>
        <form id="updateP" action="/Home/UpdateProduct" method="get">
            <div class="">
                <input type="text" name="id" v-bind:value="[p['产品编号']]" />
                <input type="text" name="name" v-bind:value="[p['产品名称']]" />
                <input type="text" name="price" v-bind:value="[p['价格']]" />
                <input type="text" name="address" v-bind:value="[p['产地']]" />
                <input type="text" name="id" v-bind:value="[p['生产商']]" />
                <input type="text" name="id" v-bind:value="[p['重量']]" />
            </div>
            <a role="button" class="btn" v-on:click="updateProduct(p)" data-toggle="modal" data-target="#myModal">
                修改
            </a>
        </form>
    </td>

 

posted @ 2017-11-01 22:27  fight139  阅读(486)  评论(0编辑  收藏  举报