【发布时间】:2020-04-11 00:23:33
【问题描述】:
我正在使用 Vue.js 和 Vuetify 在 Vue 组件内创建一个表单,但是我想在自动完成框中显示的学校列表丢失了。我已将它们作为数组包含在组件的数据函数中,但它们没有显示出来,并且在控制台中引发了以下错误。
[Vuetify] 无法定位目标 [data-app]
<template>
<div class="app">
<v-card width="500">
<v-card-title class="pb-0">
<h1>Sign Up</h1>
</v-card-title>
<v-card-text>
<v-form>
<v-text-field
required
label="Email"
type="email"
prepend-icon="mdi-email"
/>
<v-text-field
required
:type="showPassword ? 'text' : 'password'"
label="Password"
prepend-icon="mdi-lock"
:append-icon="showPassword ? 'mdi-eye' : 'mdi-eye-off'"
@click:append="showPassword = !showPassword"
/>
<v-text-field
required
label="First Name"
prepend-icon="mdi-account-circle"
/>
<v-text-field
required
label="Last Name"
prepend-icon="mdi-account-circle"
/>
<v-text-field
required
label="Preferred Username"
prepend-icon="mdi-account-circle"
placeholder="This name will be seen by others and identify you on the site"
/>
<v-autocomplete
label="Which school do you attend?"
:items="schools"
></v-autocomplete>
</v-form>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-btn color="info">Sign Up</v-btn>
</v-card-actions>
</v-card>
</div>
export default {
name: "signup",
data: function() {
return {
showPassword: false,
schools: [
"Ipswich High School",
"Northgate High School",
"Kesgrave",
"Ipswich Academy"
]
};
}
};
</script>
【问题讨论】:
标签: vue.js vuetify.js