vue.js - Vuetify v-autocomplete 有问题
问题描述
我在 laravel 项目中使用 vuetify.js。我创建了这样的 [station][verhicle][take a time] 表格。
它的简单形式。但是...站选择框使用了v-autocomplete组件。所以看起来输入标签是这样自动嵌入的。
这个输入标签是不必要的。我希望返回一个数组。
有什么好办法吗?谢谢你
<template>
<v-container>
<v-row dense>
<v-col sm="4">
<v-autocomplete
v-model="StationModel"
:items="stationsSon"
:search-input.sync="search"
item-text="name"
item-value="id"
name="station_id[]"
label="station"
clearable
hide-details
hide-selected
outlined
>
<template v-slot:selection="{ item,selected }">
<span>{{ item.routell_name + item.name }}</span>
</template>
<template v-slot:item="{ item }">
<v-list-item-content>
<v-list-item-title v-text="item.name"></v-list-item-title>
<v-list-item-subtitle v-text="item.routell_name"></v-list-item-subtitle>
</v-list-item-content>
</template>
</v-autocomplete>
</v-col>
<v-col sm="4">
<v-select
name="verhicle_id[]"
:items="verhiclesSon"
item-value="id"
item-text="name"
label="verhicle"
outlined
clearable
>
</v-select>
</v-col>
<v-col sm="4">
<v-text-field
name="take_time[]"
type="number"
:rules="[v => v && v.length <= 2 || 'Warn:2 charactor']"
label="take a time"
outlined
>
</v-text-field>
</v-col>
</v-row>
</v-container>
</template>
<script>
export default {
data: () => ({
stationsDefault: [],
StationModel: null,
search: null,
tab: null,
}),
watch: {
model (val) {
if (val != null) this.tab = 0;
else this.tab = null;
},
search (val) {
if (this.stationsDefault.length > 0) return;
},
},
props:{
stationsSon:{
type: Array
},
verhiclesSon:{
type: Array
},
},
methods:{
snipeDown: function(){
const target = document.getElementsByClassName('v-select__selections');
document.removeChild(target("input"));
}
},
};
</script>
解决方案
推荐阅读
- java - 如何为所有屏幕尺寸制作灵活的 UI?
- reactjs - 如何在 vue 中执行类似 React componentwillreceiveprops 的操作
- imgur - Imgur API - 注册应用程序时出现 400 错误
- django - 我究竟该如何使用 HStoreField?
- regex - 如何替换查询字符串中的第一个参数?
- amazon-web-services - CloudFront 忽略 Lambda@Edge 提供的自定义 Origin
- r - 在 R 中绘制二元逻辑回归的问题
- django - 在扩展模板 django 中使用时,leaflet_map 不起作用
- c++ - 该代码在 Dev-C++ 中没有给我任何输出
- android-appcompat - 在使用 Material Components 时我应该如何摆脱 Appcompat Style?