Karl_C
Karl_C
  • 发布:2025-03-31 17:26
  • 更新:2025-03-31 17:26
  • 阅读:59

vue3 nvue 组件内部button样式不生效

分类:uni-app

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>
2025-03-31 17:26 负责人:无 分享
已邀请:

要回复问题请先登录注册