MCPcopy
hub / github.com/vuejs/composition-api / useCssModule

Function useCssModule

src/apis/useCssModule.ts:8–23  ·  view source on GitHub ↗
(name = '$style')

Source from the content-addressed store, hash-verified

6 : {}
7
8export const useCssModule = (name = '$style'): Record<string, string> => {
9 const instance = getCurrentInstance()
10 if (!instance) {
11 __DEV__ && warn(`useCssModule must be called inside setup()`)
12 return EMPTY_OBJ
13 }
14
15 const mod = (instance.proxy as any)?.[name]
16 if (!mod) {
17 __DEV__ &&
18 warn(`Current instance does not have CSS module named "${name}".`)
19 return EMPTY_OBJ
20 }
21
22 return mod as Record<string, string>
23}
24
25/**
26 * @deprecated use `useCssModule` instead.

Callers 3

setupFunction · 0.90
setupFunction · 0.90

Calls 2

getCurrentInstanceFunction · 0.90
warnFunction · 0.90

Tested by 2

setupFunction · 0.72
setupFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…