Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong install command? #16

Closed
jordan-kaxig opened this issue Jun 16, 2020 · 2 comments
Closed

Wrong install command? #16

jordan-kaxig opened this issue Jun 16, 2020 · 2 comments
Labels
documentation solved The problem presented is considered solved and the issue closed

Comments

@jordan-kaxig
Copy link

Shouldn't
npm install vue2-google-maps
instead be
npm install gmap-vue

and
import * as VueGoogleMaps from 'vue2-google-maps'
instead be
import * as VueGoogleMaps from 'gmap-vue'

The reason for this, is that I could not get custom text field via scoped slot to work with the gmap-autocomplete component.

I looked in node_modules/vue2-google-maps/dist/components/autocomplete.vue in my project folder, and saw:

<template>
  <input
    ref="input"
    v-bind="$attrs"
    v-on="$listeners"
    />
</template>

I.e, No support for slots

Then I looked in you github repository in packages/gmap-vue/src/components/autocomplete.vue and saw:

<template>
  <span v-if="$scopedSlots['input']">
    <slot name="input" v-bind:attrs="$attrs" v-bind:listeners="$listeners" :ref="input"></slot>
  </span>
  <input v-else-if="!$scopedSlots['input']" ref="input" v-bind="$attrs" v-on="$listeners" />
</template>

I.e, support for slots.

So I unistalled vue2-google-maps via:
npm uninstall vue2-google-maps

and then ran
npm install gmap-vue

and changed
import * as VueGoogleMaps from 'vue2-google-maps'
to
import * as VueGoogleMaps from 'gmap-vue'
in my main.js and then the "slots" started to work.

@jordan-kaxig
Copy link
Author

I found the link to your documentation now. Sorry
https://diegoazh.github.io/gmap-vue/

@diegoazh
Copy link
Owner

@yze77 check the new documentation if you find any error please feel free to make a PR or open an issue again, Thank you.

@diegoazh diegoazh added documentation solved The problem presented is considered solved and the issue closed labels Nov 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation solved The problem presented is considered solved and the issue closed
Projects
None yet
Development

No branches or pull requests

2 participants