一般使用行内形式体现
例子
<template>
<div class="emptyStyle">
<div class="emptyBox" :style="{ marginTop: top }">
<div class="pic"></div>
<div class="wordUp font-tip" :style="{ lineHeight: lineHightUp }">
{{ lineUp }}
</div>
<div class="wordDown font-tip" :style="{ lineHeight: lineHightDown }">
{{ lineDown }}
</div>
</div>
</div>
</template>
<script>
export default {
props: {
lineUp: {
type: String,
default: () => ''
},
lineDown: {
type: String,
default: () => ''
},
lineHightUp: {
type: String,
default: () => '20px'
},
lineHightDown: {
type: String,
default: () => '1px'
},
top: {
type: String,
default: () => '0'
}
}
}
</script>
<style lang="scss" scoped>
.emptyStyle {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
.emptyBox {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
// transform: translate(0, -50%);
.pic {
width: 80px;
height: 74px;
background: url('../assets/image/empty_data.png') center center no-repeat;
}
.wordUp {
}
.wordDown {
}
}
}
</style>
特别注意: element 可能因为层级问题失效
解决办法 , 动态css- 类名 :class=“true?test:’’”