vue-ssr

How to set InnerText with directive in SSR Vue/Nuxt

安稳与你 提交于 2020-01-06 04:46:15
问题 I want to port my vue directive to also render server side. client side: mydirective(el,binding,vnode){ el.innerText = vnode.context.$data.points } What i have working so far in nuxt.config.js: render: { bundleRenderer: { directives: { mydirective(node, binding){ var points = node.context.$data.points //works node.data.style = [{backgroundColor: 'green'}] //works node.data.innerText = points //NOT working node.data.textContent = points //NOT working } I cant find the element reference. i used

SSR build says “document is not defined” for a Vuejs cli3 SPA app using a Vue cli3 library

允我心安 提交于 2019-12-22 08:04:11
问题 I have a fairly complex SPA Vue.js app created with Vue CLI v3. I want to transform this app to benefit from SSR (although I might end up using only preprendering...) My app is using custom Vuejs libraries created with the CLI v3 as well. These libs embbed CSS, and I would like to continue to do so. I've probably read everything that the world has produced on Vue cli, vue-loader, vue-style-loader, vue.config.js, extract css etc, but I keep failing. Here is the error message of my running app