我的組件VUE是這樣的:如何設置vue.js 2中選定的選項?
<template>
<select class="form-control" v-model="selected" :required @change="changeLocation">
<option :selected>Choose Province</option>
<option v-for="option in options" v-bind:value="option.id" >{{ option.name }}</option>
</select>
</template>
我用這個:<option :selected>Choose Province</option>
選定
但whene執行,在吞氣表存在錯誤
的錯誤是這樣的:
ERROR in ./~/vue-loader/lib/template-compiler.js?id=data-v-53777228!./~/vue-load er/lib/selector.js?type=template&index=0!./resources/assets/js/components/bootst rap/LocationBsSelect.vue Module build failed: SyntaxError: Unexpected token (28:4)
似乎我的腳步是錯的
我該如何解決?
您提到有錯誤。你應該把它包含在問題中。 – nicooga
@nicooga,我已經更新了我的問題 –