nvue页面,使用vue3模式,调试状态下
在封装的组件中,定义button类名样式无效,全局定义的样式及调用此组件的页面中定义生效
vue2模式调试状态下没有此问题
manifest配置中"renderer" 为 "native"
hbuilderx为4.57,调试手机红米note14,安卓版本14,电脑操作系统win10,版本号22H2,内部版本19045.5608
复制代码// 子组件
<template>
<view>
<button class="btn-demo">asddddd</button>
</view>
</template>
<script setup>
</script>
<style lang="scss" scoped>
// 这个样式不会生效
.btn-demo{
width: 100rpx;
height: 50rpx;
background-color: red;
}
</style>
复制代码// 父页面
<template>
<demo>
</demo>
</template>
<script setup>
import demo from './demo.nvue'
</script>
<style lang="scss" scoped>
// 这个样式会生效
// .btn-demo{
// width: 100rpx;
// height: 50rpx;
// background-color: red;
// }
</style>
0 个回复