-
Notifications
You must be signed in to change notification settings - Fork 341
Closed
Description
vue version: 2.6.12
@vuejs/composition-api version: 1.0.0-beta.22
beta22, the useCssModule did'nt adapt the change of getCurrentInstance.
composition-api/src/apis/useCssModule.ts
Lines 8 to 23 in 4b2f1ab
| export const useCSSModule = (name = '$style'): Record<string, string> => { | |
| const instance = getCurrentInstance() | |
| if (!instance) { | |
| __DEV__ && warn(`useCSSModule must be called inside setup()`) | |
| return EMPTY_OBJ | |
| } | |
| const mod = (instance as any)[name] | |
| if (!mod) { | |
| __DEV__ && | |
| warn(`Current instance does not have CSS module named "${name}".`) | |
| return EMPTY_OBJ | |
| } | |
| return mod as Record<string, string> | |
| } |
export const useCSSModule = (name = '$style'): Record<string, string> => {
const instance = getCurrentInstance()
if (!instance) {
__DEV__ && warn(`useCSSModule must be called inside setup()`)
return EMPTY_OBJ
}
const mod = (instance as any)[name] //Here
if (!mod) {
__DEV__ &&
warn(`Current instance does not have CSS module named "${name}".`)
return EMPTY_OBJ
}
return mod as Record<string, string>
}Metadata
Metadata
Assignees
Labels
No labels
