我在使用 Vuetify 数据表时遇到一个奇怪的问题。我有两个相关的文件:父文件:
<!-- DataTable component with articles and headers passed as props -->
<ArticleTable :propData="articles" :headers="headers"></ArticleTable>
<script>
//Add data
data() {
return {
//For the article list from the server
articles: null,
//Headers for Datatable
headers: [
{ text: "Article #", value: "articleID" },
{ text: "Title", value: "articleTitle" },
{ text: "Content", value: "articleContent" },
{ text: "Click to Like", value: "liked", sortable: false },
{ text: "Likes", value: "articleLikes" }
]
};
},
//When the component is …Run Code Online (Sandbox Code Playgroud) 我有一个 vuetify 自动完成组件,它显示用户从中选择的名称列表。我想要一个后备情况,如果用户输入不在列表中的内容,该值仍然被接受。这是我的代码:
<v-autocomplete
v-model="model.name"
:items="users"
placeholder="Enter your name"
no-data-text="Name not Found"
clearable
></v-autocomplete>
Run Code Online (Sandbox Code Playgroud)
其中自动完成的值绑定到数据变量,项目是来自我的服务器的数组。自动完成组件是接受数据提交的更大表单的一部分