laravel vue.js属于复选框

时间:2019-03-20 17:40:03

标签: laravel vue.js checkbox

我正在使用Laravel,头版页面由VueJS呈现。 公司有很多法院 法院有很多运动项目(使用数据透视表)

http://crm.jywebsoft.com/admin/company/edit/1

我正在为公司编辑页面。 在页面底部,属于公司的法院正在显示(可拖动)。

在法院的体育部门

<draggable class="row" v-model="courts" :options="{handle:'.sort-handler'}">
<div class="col-md-4" v-for="(court, index) in courts" :key="court.id">
    <div class="card">
        <div class="card-body">
            <div class="row">
                <div class="col-lg-12 sort-handler" style="cursor: move;"><span class="pull-left"><i class="fa fa-reorder fa-lg"></i></span>
                    <button class="btn btn-danger btn-sm pull-right" @click.prevent="courts.splice(index,1)"><i class="fa fa-remove"></i></button>
                </div>
                <div class="form-group col-lg-12">
                    <label for="example-email-input1" class="col-form-label">Court Name</label>
                    <div class="">
                        <input type="hidden" :name="'courts['+index+'][id]'"
                               :value="court.id>0?court.id:''"/>
                        <input class="form-control" type="text" :name="'courts['+index+'][name]'" v-model="court.court_name" placeholder="">
                    </div>
                </div>
                <div class="form-group col-lg-12">
                    <label for="example-email-input1" class="col-form-label">Description</label>
                    <div class="">
                        <input class="form-control" v-model="court.description" :name="'courts['+index+'][description]'" type="text" placeholder="">
                    </div>
                </div>
                <div class="form-group col-lg-12">
                    <label for="example-email-input1" class="col-form-label">Price</label>
                    <div class="">
                        <input class="form-control" v-model="court.price" type="text" :name="'courts['+index+'][price]'" placeholder="">
                    </div>
                </div>
                <div class="form-group col-lg-12">
                    <label for="example-email-input1" class="col-form-label">Sports</label>
                    <div class="">

                        <div class="" v-for="(sport, index_sport) in sports" :key="sport.id">
                            <div class="">
                                <input type="checkbox" class="" :id="'courts_'+index+'_'+sport.name"
                                       :name="'courts['+index+'][sports][]'" data-parsley-multiple="groups" data-parsley-mincheck="2"
                                       v-model="court.sports" :value="sport"
                                >
                                <label class="" :for="'courts_'+index+'_'+sport.name">@{{ sport.name }}</label>
                            </div>
                        </div>
                        <select class="form-control" v-model="court.status" :name="'courts['+index+'][status]'">

                        </select>
                    </div>
                </div>

                <div class="form-group col-lg-12">
                    <label for="example-email-input1" class="col-form-label">Status</label>
                    <div class="">
                        <select class="form-control" v-model="court.status" :name="'courts['+index+'][status]'">
                            <option value="1">Active</option>
                            <option value="2">Delete</option>
                        </select>
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>

我如何检查属于每个法院的运动?

0 个答案:

没有答案