javascript - 是否可以仅使用 vuetify-google-autocomplete 列出城市?
问题描述
是否可以像这样仅在 vuetify-google-autocomplete 中列出城市?(附图片)
我当前的自动完成看起来像这样,默认情况下它正在搜索完整地址。
我在文档或任何其他页面上都找不到有关此主题的信息,因此我在这里寻求帮助。
我的代码:
应用程序.js:
import VuetifyGoogleAutocomplete from 'vuetify-google-autocomplete';
Vue.use(VuetifyGoogleAutocomplete, {
apiKey: 'xxxxxxxxxxxxxxxxxxxxxxxxx',
installComponents: true,
vueGoogleMapsCompatibility: false
});
组件.js:
<vuetify-google-autocomplete
type="text"
ref="location"
v-model="location"
id="map"
v-on:placechanged="getAddressData"
>
解决方案
就在这里!你可以这样做:
<vuetify-google-autocomplete
id="map"
placeholder="Location"
types="(cities)"
>
</vuetify-google-autocomplete>
推荐阅读
- java - 不兼容的类型不能转换为 Fragment
- webpack - babel-polyfill 和 webpack 出错
- javascript - 从网站调用 Nodemailer 脚本时不执行
- amazon-web-services - aws api 网关端点不是公共的
- c# - 使用 SqlCommand 时出现错误
- java - Java:如何将 JSON 对象插入到 CLOB 到 oracle 数据库中
- ruby-on-rails - Ruby:如何循环获取调用
- python - 如何在 Django 中更改 date_joined 和 datetimefield 格式?
- sockets - Epoll 事件(EPOLLLT)仅在 udp 套接字上触发一次
- python - 使用 django rest 框架添加到购物车