feat: ssr support for <style vars>
This commit is contained in:
11
packages/server-renderer/src/helpers/ssrResolveCssVars.ts
Normal file
11
packages/server-renderer/src/helpers/ssrResolveCssVars.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
export function ssrResolveCssVars(
|
||||
source: Record<string, string>,
|
||||
scopeId?: string
|
||||
) {
|
||||
const style: Record<string, string> = {}
|
||||
const prefix = scopeId ? `${scopeId.replace(/^data-v-/, '')}-` : ``
|
||||
for (const key in source) {
|
||||
style[`--${prefix}${key}`] = source[key]
|
||||
}
|
||||
return { style }
|
||||
}
|
||||
Reference in New Issue
Block a user