Dynamic data not rendering
See original GitHub issueprerender-spa-plugin 3.x webpack 4.x
after all the other issues about dynamic data
,request data
,dynamic content
, e.g #178 i still can’t slove my problem…
webpack.config
new PrerenderSpaPlugin({
staticDir: path.resolve(__dirname, '../dist'),
routes: ['', '/home', '/about'],
render: new Renderer({
renderAfterTime: 5000,
headless: true,
renderAfterDocumentEvent: 'render-event'
})
})
page code
mounted () {
// this.$nextTick(() => {
axios.get('https://api.github.com/users/lz82')
.then(res => {
this.pic = res.data.avatar_url
this.url = res.data.url
this.$nextTick(() => {
document.dispatchEvent(new Event('render-event'))
})
})
// })
}
dist file
but there is only container is static html file but not dynamic data.
<div id="app"><div data-v-68d85562="" class="container"><img data-v-68d85562="" src="" alt="">
url:
</div></div>
Issue Analytics
- State:
- Created 5 years ago
- Comments:16
Top Results From Across the Web
Dynamic data not rendering in builder - Bugs
I have just tried the query loop. When I add dynamic data the builder doesn't render Heading and Basic Text for the first...
Read more >Dynamic data are not rendering on the browser - Stack Overflow
Good day, I'm trying to create a MEARN stack application with react-redux. I am already able to post data to my MongoDB atlas,...
Read more >Why Dynamic Rendering Is Not a Long-Term Solution | Onely
Dynamic rendering is a workaround and not a long-term solution for JavaScript issues, and; Google recommends using server-side rendering, ...
Read more >Dynamic Rendering | Google Search Central | Documentation
Dynamic rendering is a workaround for websites where JavaScript-generated content is not available to search engines. A dynamic rendering server detects bots ...
Read more >Dynamic component loader - Angular
Instead, you need a way to load a new component without a fixed reference to the ... for dynamic components because it doesn't...
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
@chentianyuan thx your help~ i’ve tried remove
$nextTick
before emmitnew Event('render-event')
, it doesn’t work…but when i use
renderAfterTime: 5000
, it works.if your project is using
renderAfterDocumentEvent
, can u push it to your repo? 😃thank @Tribex help~
try to remove the $nextTick,it seems to that prerender is async,and will execute after dom refresh