选择后如何显示城市,州?

我正在使用示例https://community.algolia.com/places/examples.html#city-search

中的城市搜索

选择后,仅显示城市。如何将其显示为城市,州?

<input type="search" id="city" class="form-control" placeholder="In which city do you live?" />

<script src="https://cdn.jsdelivr.net/npm/places.js@1.17.1"></script>
<script>
(function() {
  var placesAutocomplete = places({
    appId: '<YOUR_PLACES_APP_ID>',apiKey: '<YOUR_PLACES_API_KEY>',container: document.querySelector('#city'),templates: {
      value: function(suggestion) {
        return suggestion.name;
      }
    }
  }).configure({
    type: 'city',aroundLatLngViaIP: false,});
})();
</script>
xiaojiamail 回答:选择后如何显示城市,州?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2964026.html

大家都在问