<template>
<view class="pageBox">
{{color}}
</view>
</template>
<script>
export default {
data() {
return {
color: '#FF0000'
}
}
}
</script>
<!-- -->
<style lang="scss" scoped >
.pageBox{
width: 100%;
min-height: 100vh;
color: v-bind(color);
box-sizing: border-box;
}
</style>
- 发布:2022-02-14 11:54
- 更新:2024-05-10 14:27
- 阅读:2672
产品分类: HbuilderX
PC开发环境操作系统: Mac
PC开发环境操作系统版本号: 11.6.1
HBuilderX版本号: 3.3.11
示例代码:
操作步骤:
<template>
<view class="pageBox">
{{color}}
</view>
</template>
<script>
export default {
data() {
return {
color: '#FF0000'
}
}
}
</script>
<!-- -->
<style lang="scss" scoped >
.pageBox{
width: 100%;
min-height: 100vh;
color: v-bind(color);
box-sizing: border-box;
}
</style>
<template>
<view class="pageBox">
{{color}}
</view>
</template>
<script>
export default {
data() {
return {
color: '#FF0000'
}
}
}
</script>
<!-- -->
<style lang="scss" scoped >
.pageBox{
width: 100%;
min-height: 100vh;
color: v-bind(color);
box-sizing: border-box;
}
</style>
预期结果:
<view class="pageBox" style="--57280228-color:#FF0000; --57280228-statusBarHeight:30px;">#FF0000</view>
<view class="pageBox" style="--57280228-color:#FF0000; --57280228-statusBarHeight:30px;">#FF0000</view>
实际结果:
<view class="pageBox" >#FF0000</view>
<view class="pageBox" >#FF0000</view>
bug描述:
vue3 css v-bind 小程序绑定的值未出现在标签上 导致颜色加载失败
manifest.json v3编译
snail_lt
你好,请问解决了吗,公司要转vue3,迫切需要使用这个属性,谢谢!
2022-05-25 09:53
aaha
你好,请问这个问题何时能够解决
2022-08-22 09:01