[Nuxt] Unable to render map when wrapped in <no-ssr>
See original GitHub issueHello ! When using the nuxt <no-ssr> components that delays the render of a component until the page is mounted (to ensure it’s only rendered when the window is ready), I do not manage to render the component. To simplify the tests, i rewrote my component like so:
<template>
<section class="page stores">
<vl-map
v-if="mounted"
id="stores__container"
ref="map"
:controls="false"
data-projection="EPSG:4326">
<vl-view
ref="view"
:zoom.sync="zoom"
:center.sync="center">
</vl-view>
<vl-layer-tile id="osm">
<vl-source-osm></vl-source-osm>
</vl-layer-tile>
</vl-map>
</section>
</template>
<script>
export default {
name: 'Stores',
data() {
return {
mounted: false
}
},
mounted() {
this.mounted = true
}
}
</script>
When the component is mounted:
- the reference exists in the context
this.$refs.map
but it seems that the vl-map component is not rendered - I can access the component map like so
this.$refs.map.$map
so it seems to be instantiated; - the
this.$refs.map.$map.isRendered()
method returns me false so it seems that it is not rendered yet but I can’t find a way to trigger a re-render.
Does anyone has an idea on how to trigger a re-render on the component ? Thanks in advance for your replies (and thanks to the author for the supernice work!)
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Using Non-SSR Friendly Components with Next.js
For example, let's assume that Home component is needed to be rendered on the client-side. Here's how we do it. import React from...
Read more >Server Side Rendering - Nuxt
Server-side rendering (SSR), is the ability of an application to contribute by displaying the web-page on the server instead of rendering it in...
Read more >Nuxt pre-rendering command fails to generate static routes
I am unable to reproduce this behaviour with a new project created by running npx create-nuxt-app <project-name> . Additionally, I was able ...
Read more >Does Blood Pressure Medicine Make Your Nose Run [Tenex] How ...
Although it can t look down on people, someone can report a letter does blood pressure medicine make your nose run or something...
Read more >Medicare Claims Processing Manual Chapter 4, Part B Hospital
250.3.2 - Physician Rendering Anesthesia in a Hospital Outpatient Setting ... reported on the same claim is packaged into payment for the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @mgiraldo ! for starters i created a plugin:
and a module :
It allows me to load the component and the styles as demonstrated in the doc here and then I include it in the nuxt config with the
ssr: false
since the window object is required:Afterwards have a look to the previous responses, you should have all the informations needed. Hope that helps !
For anyone passing by the working shape of the component is the following
and the style