查看“︁Node.js/nuxt/css module”︁的源代码
来自康健生活
←
Node.js/nuxt/css module
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
== 配置 == 配置文件 {{hc|nuxt.config.js|<syntaxhighlight lang="javascript"> build: { css: { loaderOptions: { css: { localIdentName: '[name]__[local]-[hash:base64:5]', camelCase: true } } }, }</syntaxhighlight>}} 或者 {{hc|nuxt.config.js|<syntaxhighlight lang="javascript"> { loaders:{ cssModules: { localIdentName: '[local]_[hash:base64:5]', modules: true, camelCase: true }, sass: { indentedSyntax: true }, }, }</syntaxhighlight>}} 在配置文件的[https://zh.nuxtjs.org/api/configuration-build/#loaderscss-and-loaderscssmodules 说明文档]中标注了: {{Warning|cssModules 是使用的 loader 选项 [https://vue-loader.vuejs.org/guide/css-modules.html#usage CSS Modules]}} == 使用方法 == === style === <syntaxhighlight lang="html5"> <template> <div :class="$header.authentication"> <!-- logo 模块 --> <div :class="$header.authentication__logo"> <img :class="$header.img" src="~assets/img/logo.png"/> ... </div> <button :class="{ [$header.button]: true, }">登录</button> </template> <style module="header" lang="scss">@import "./networkAuthorizationAuthentication";</style> <script> export default { data: () => ( console.log(this.$style) rturn { list } ) } </script></syntaxhighlight>
此页面嵌入的页面:
模板:Hc
(
查看源代码
)
模板:Hc/style.css
(
查看源代码
)
模板:Meta box
(
查看源代码
)
模板:Warning
(
查看源代码
)
模板:Warning/style.css
(
查看源代码
)
返回
Node.js/nuxt/css module
。
导航菜单
康健生活
搜索
user-page
通知
user-interface-preferences
个人工具
登录
五一
多读书,多运动,多到远处走走,再看看不一样的世界。