Giter VIP home page Giter VIP logo

Comments (17)

mfcarneiro avatar mfcarneiro commented on July 26, 2024 2

@melliott03,
Did you registered the vue-place in a separate file and imported on plugins: [] within the nuxt.config file?

I registered using Vue.component:

// vue-places.js

import Vue from 'vue';
import VuePlaces from 'vue-places';

Vue.component('VuePlaces', VuePlaces);
 

Then import on plugins with the tag ssr= false

// nuxt.config.js

plugins: [
	{ src: '~plugins/vue-places', ssr: false }
],

This resolved the problem with unexpected token. The only problem that I'm facing now is this component itself, for no reason, seems to reloading when I change the steps in my stepper component (in my case) and crash the styles and functionalityes

component-error

You can type but the functionality reloaded and crashes.

I can't spend too much time with this problem, but I will try to help with something.

from vue-places.

melliott03 avatar melliott03 commented on July 26, 2024 1

Thanks for getting back to me on this! I registered the plugin in nuxt.config.js as you did. It works but when I reload, I am now experiencing the same problem as you with the style and functionality crashing.

from vue-places.

melliott03 avatar melliott03 commented on July 26, 2024 1

BTW I have found out that there is a difference between this Places Geolation data only returns geocoordinates at the street level, not the house level. I need house level geolocation data so I will be looking at implementing a different solution such as Google.

screen shot 2019-03-01 at 7 48 39 am

from vue-places.

melliott03 avatar melliott03 commented on July 26, 2024

Has anyone been able to integrate with Nuxt? The plugin works fine when I navigate to the page but breaks when I refresh the page.
screen shot 2019-02-26 at 9 15 00 pm

from vue-places.

melliott03 avatar melliott03 commented on July 26, 2024

Okay, now it works on page reload if I wrap it in tags

from vue-places.

mfcarneiro avatar mfcarneiro commented on July 26, 2024

I'm having this reload issue yet, but works when the component want to work haha

Which tags do you mean?

from vue-places.

melliott03 avatar melliott03 commented on July 26, 2024

Here's my setup:

I use the tag and that seems to do the trick. The no-ssr Component

<template>
  <no-ssr placeholder="Loading...">
    <div>
      <places
        v-model="form.country.label"
        placeholder="Where are we going ?"
        @change="val => { form.country.data = val }"
        :options="{ countries: ['US'] }"
      ></places>
      <div>{{form.country.data.latlng}}</div>
    </div>
  </no-ssr>
</template>

from vue-places.

mfcarneiro avatar mfcarneiro commented on July 26, 2024

Oh, I see! I will try this <no-ssr>.

Edit: Didn't work, but I will se in dept now

Thanks!

from vue-places.

melliott03 avatar melliott03 commented on July 26, 2024

Yep, that's Nuxt.

from vue-places.

mfcarneiro avatar mfcarneiro commented on July 26, 2024

Are you importing the vue-place within the component too?

from vue-places.

melliott03 avatar melliott03 commented on July 26, 2024
//in vue-places.js

import Vue from 'vue';
import VuePlaces from 'vue-places';

Vue.component('places', VuePlaces);

//in nuxt.config.js
 plugins: [
    { src: '~/plugins/vue-places', ssr: false },
  ]

from vue-places.

mfcarneiro avatar mfcarneiro commented on July 26, 2024

Alright, like I did, but it's working every time that you reload?

from vue-places.

mfcarneiro avatar mfcarneiro commented on July 26, 2024

@melliott03 You already solve this reload problem? Here still persists when I reload for the third time, weird! hahaha

from vue-places.

melliott03 avatar melliott03 commented on July 26, 2024

@melliott03 You already solve this reload problem? Here still persists when I reload for the third time, weird! hahaha

@mfcarneiro It works everytime I reload...can you share what you have in your
vue-places.js
nuxt.config.js
component .vue

from vue-places.

mfcarneiro avatar mfcarneiro commented on July 26, 2024

@melliott03 It's the same config that you've showed

I did a computed property instead to have this val => { object.data = val }, only difference...

from vue-places.

mfcarneiro avatar mfcarneiro commented on July 26, 2024

@melliott03,

Just for the record, I'm using the vue2-googlemaps autocomplete functionality. It use s the google API and maybe fits to your needs of "house level".

from vue-places.

Gomah avatar Gomah commented on July 26, 2024

Fixed in v2 3e4c8bb

from vue-places.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.