diff --git a/src/api/global-api.md b/src/api/global-api.md index d30851a246..daad02a127 100644 --- a/src/api/global-api.md +++ b/src/api/global-api.md @@ -474,3 +474,47 @@ export default { } } ``` + +## useCssModule + +:::warning +`useCssModule` can only be used within `render` or `setup` functions. +::: + +Allows CSS modules to be accessed within the [`setup`](/api/composition-api.html#setup) function of a [single-file component](/guide/single-file-component.html): + +```vue + + + +``` + +For more information about using CSS modules, see [Vue Loader - CSS Modules](https://vue-loader.vuejs.org/guide/css-modules.html). + +### Arguments + +Accepts one argument: `name` + +#### name + +- **Type:** `String` + +- **Details:** + + The name of the CSS module. Defaults to `'$style'`.