【发布时间】:2018-04-23 18:36:18
【问题描述】:
请帮助我的 Form.vue 代码
<template>
<div v-if="alert.message" :class="['alert alert-' + alert.type]">
<p>{{ alert.message }}</p>
</div>
<div class="col-md-4">
<div :class="['form-group', 'label-floating',{ 'has-error' : errors.city}]">
<label class="control-label">Kota</label>
<select @change="city" v-model="state.city" class="form-control" required>
<option v-for="city in cities" :value="city.kota_id">{{city.kota_nama}}</option>
</select>
<span v-if="errors.city" class="label label-danger">
{{ errors.city[0]}}
</span>
</div>
</div>
<div class="col-md-4">
<div :class="['form-group', 'label-floating',{ 'has-error' : errors.profile}]">
<label class="control-label">Tahun</label>
<select @change="profile" v-model="state.profle" class="form-control" required>
<option v-for="profile in profiles" :value="profile.profile_id">{{profile.profile_tahun}}</option>
</select>
<span v-if="errors.profile" class="label label-danger">
{{ errors.profile[0]}}
</span>
</div>
</div>
我很困惑,我的错误...我尝试更改 v-show 并且仍然得到类似的错误
Component template should contain exactly one root element. If you are using v-if on multiple elements, use v-else-if to chain them instead.
【问题讨论】: