feat: ssr support for <style vars>

This commit is contained in:
Evan You
2020-07-12 18:04:09 -04:00
parent b6cdd5621e
commit b9595e64cf
17 changed files with 256 additions and 15 deletions

View File

@@ -1,7 +1,7 @@
import { warn, getCurrentInstance } from '@vue/runtime-core'
import { EMPTY_OBJ } from '@vue/shared'
export function useCSSModule(name = '$style'): Record<string, string> {
export function useCssModule(name = '$style'): Record<string, string> {
if (!__GLOBAL__) {
const instance = getCurrentInstance()!
if (!instance) {

View File

@@ -9,7 +9,7 @@ import {
} from '@vue/runtime-core'
import { ShapeFlags } from '@vue/shared/src'
export function useCSSVars(
export function useCssVars(
getter: (ctx: ComponentPublicInstance) => Record<string, string>,
scoped = false
) {

View File

@@ -114,8 +114,8 @@ function normalizeContainer(container: Element | string): Element | null {
}
// SFC CSS utilities
export { useCSSModule } from './helpers/useCssModule'
export { useCSSVars } from './helpers/useCssVars'
export { useCssModule } from './helpers/useCssModule'
export { useCssVars } from './helpers/useCssVars'
// DOM-only components
export { Transition, TransitionProps } from './components/Transition'