M
M
Maxim2021-02-23 11:25:46
Google Maps
Maxim, 2021-02-23 11:25:46

Google autocomplete gives error in Nuxtjs?

Why issues

245:7   error  Do not use 'new' for side effects  no-new
  245:11  error  'google' is not defined            no-undef

✖ 2 problems (2 errors, 0 warnings)

                                                                                                 friendly-errors 11:22:59
 @ ./.nuxt/router.js 45:24-47:3
 @ ./.nuxt/index.js
 @ ./.nuxt/client.js
 @ multi ./node_modules/@nuxt/components/lib/installComponents.js eventsource-polyfill webpack-hot-middleware/client?reload=true&timeout=30000&ansiColors=&overlayStyles=&path=%2F__webpack_hmr%2Fclient&name=client ./.nuxt/client.js


script included in nuxt.config.js

input
<div class="auth-form__group">
          <label for="">Адрес магазина</label>
          <input
            ref="address"
            v-model="form.address"
            type="text"
            class="form-control"
          />
        </div>

method

mounted() {
    const query = new google.maps.places.Autocomplete(this.$refs.address)
  },

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question