Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vue.js 如何为v-select中的“选定”选项中的标签使用自定义模板?_Vue.js_Vuejs2_Vue Component_V Select - Fatal编程技术网

Vue.js 如何为v-select中的“选定”选项中的标签使用自定义模板?

Vue.js 如何为v-select中的“选定”选项中的标签使用自定义模板?,vue.js,vuejs2,vue-component,v-select,Vue.js,Vuejs2,Vue Component,V Select,我在v-select中使用了自定义标签的。在这里,一切正常。如此处屏幕截图所示打开选项时,自定义标签工作正常:但自定义标签不适用于所选选项或关闭所选选项时:。 以下是我用来在v-select中使用自定义模板的代码段: <v-select @input="updateShippingCharge" v-model="selected" :options="options"> <template slot="option" slot-scope="optio

我在v-select中使用了自定义标签的
。在这里,一切正常。如此处屏幕截图所示打开选项时,自定义标签工作正常:但自定义标签不适用于所选选项或关闭所选选项时:。 以下是我用来在v-select中使用自定义模板的代码段:

<v-select @input="updateShippingCharge"
    v-model="selected"
    :options="options">
    <template slot="option" slot-scope="option">
        <span :class="['flag-icon', `flag icon-${option.value.toLowerCase()}`]"></span>
            {{ option.label }}
    </template>
</v-select>

{{option.label}
您可能会发现这很有帮助。