使用SASS
index.vue
<template>
<view class="content box" >
<image class="logo" src="/static/logo.png"></image>
</view>
</template>
<script>
</script>
<style lang="scss">
$width:200rpx; //定义变量
//层级CSS
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
//&父级 若要表示同级: .content.box
&.box{
border: 1px red solid;
}
.logo {
height: $width;
width: $width;
margin-top: 200rpx;
margin-left: auto;
margin-right: auto;
margin-bottom: 50rpx;
}
.text-area {
display: flex;
justify-content: center;
.title {
font-size: 36rpx;
color: #8f8f94;
}
}
}
</style>