0.15.14 • Published 5 days ago
@css-render/vue3-ssr v0.15.14
@css-render/vue3-ssr
Example
Server
import { createSSRApp } from 'vue'
import { renderToString } from '@vue/server-renderer'
import { setup } = from '@css-render/vue3-ssr'
// For each request, you need to create a new app
const ssrApp = createSSRApp(App)
const { collect } = setup(ssrApp)
renderToString(ssrApp).then(appHtml => {
const css = collect()
const page = `<!DOCTYPE html>
<html>
<head>${css}</head>
<body><div id="app">${appHtml}</div></body>
</html>`
})
Component
import { defineComponent } from 'vue'
import { useSsrAdapter } from '@css-render/vue3-ssr'
const Child = defineComponent({
setup() {
c("div", {
color: "red",
}).mount({
id: "mount-id",
// It always returns undefined in browser (document === undefined)
ssr: useSsrAdapter(),
});
},
render() {
return h("div", null, "Child");
},
});
0.15.14
5 days ago
0.15.13
5 days ago
0.15.12
1 year ago
0.15.11
2 years ago
0.15.10
2 years ago
0.15.9
2 years ago
0.15.7
2 years ago
0.15.8
2 years ago
0.15.6
3 years ago
0.15.5
3 years ago
0.15.4
3 years ago
0.15.0
3 years ago
0.15.1
3 years ago
0.15.2
3 years ago
0.15.3
3 years ago
0.13.7
3 years ago
0.13.8
3 years ago
0.13.9
3 years ago
0.14.0
3 years ago
0.14.1
3 years ago
0.13.6
3 years ago
0.13.4
3 years ago
0.13.5
3 years ago
0.13.2
3 years ago
0.13.1
3 years ago
0.13.0
3 years ago