VUE_vue动态绑定style属性
方式一:
<!-- statusBarHeight 动态值 -->
<div :style="{ height: `${ statusBarHeight}px`,background:'#fff' }"></div>
export default {
data() {
return {
statusBarHeight:100
}
}
}
方式二:
<!-- statusBarHeight 动态值 -->
<div :style="{ height: statusBarHeight+'px',background:'#fff'}"></div>
export default {
data() {
return {
statusBarHeight:100
}
}
}
还没有评论,来说两句吧...