K
K
Kirill Ushakov2018-03-26 23:09:04
Vue.js
Kirill Ushakov, 2018-03-26 23:09:04

vue js. Initialize component on click?

There is a hidden block with a component that opens at the user's request. And there is one problem, the component contains Google maps, which are not initialized in the hidden block. If the block is initially visible, then everything is OK.
How to initialize or update a component on click?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikita Velko, 2018-03-26
@nikichv

Through $reftake the component and call $forceUpdate()?
Type:

<vue-google-map ref="map" :coords=[lat, lng] />
...
methods: {
  reinitMap() {
    this.$refs.map.$forceUpdate();
  }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question