87,907
社区成员
发帖
与我相关
我的任务
分享
<template>
<header :class="$style.mainHeader">
<h1>JTodo</h1>
</header>
</template>
<style lang="stylus" scoped>
.main-header{
text-align center
h1{
font-size 100px
color: rgba(175, 47, 47, 0.4)
font-weight 100
margin 20px
}
}
</style>
module.exports = (isDev) =>{
return {
//删除vue中的文本空格
preserveWhitepace:true,
//将所有的样式提取到独立的CSS文件(提取出来之后,每个模块加载,都需要加载整个CSS文件)
extractCSS:!isDev,
//
cssModules:{
//css的文件名(文件路径)
localIdentName:'[path]-[name]-[hash:base64:5]',
//变量命名规则(骆驼式命名法),css中的zhang-zw会被自动转成zhangZw
camelCase:true
},
}
}
<div v-bind:class="{ active: isActive }"></div>
后面要跟一个bool值的。
比如
<div class="static"
v-bind:class="{ active: isActive, 'text-danger': hasError }">
</div>
data: {
isActive: true,
hasError: false
}
这些都是官网上面的。基础应用把。
至于$能不能直接用,这个不太清楚。