uni-ui icon indicating copy to clipboard operation
uni-ui copied to clipboard

微信小程序uni-popup弹出层样式丢失

Open ashuicoder opened this issue 3 years ago • 1 comments

image mask层样式丢失,设置mask-background-color熟悉也不生效

ashuicoder avatar Aug 11 '22 09:08 ashuicoder

未测试出此bug,请尝试下面的例子,是否能复现此bug,或提供可复现的 demo :

<template>
	<view>
		<button @click="open">打开弹窗</button>
		<uni-popup ref="popup" mask-background-color="rgba(255,0,0,0.5)">
			<view class="popup-box">
				<text>popup</text>
			</view>
		</uni-popup>
	</view>
</template>

<script setup>
	import {
		ref
	} from 'vue'
	const popup = ref(null)

	function open() {
		popup.value.open('center')
	}
</script>

<style>
	.popup-box{
		width: 200rpx;
		height: 200rpx;
		background-color: white;
	}
</style>

codexu avatar Aug 11 '22 10:08 codexu

未测试出此bug,请尝试下面的例子,是否能复现此bug,或提供可复现的 demo :

<template>
	<view>
		<button @click="open">打开弹窗</button>
		<uni-popup ref="popup" mask-background-color="rgba(255,0,0,0.5)">
			<view class="popup-box">
				<text>popup</text>
			</view>
		</uni-popup>
	</view>
</template>

<script setup>
	import {
		ref
	} from 'vue'
	const popup = ref(null)

	function open() {
		popup.value.open('center')
	}
</script>

<style>
	.popup-box{
		width: 200rpx;
		height: 200rpx;
		background-color: white;
	}
</style>

找到问题了,是因为你们内部定义了一个叫.center的class,我自己也定义了一个,样式冲突,不过还是希望你们作为一个公共的ui库,能维护自己的class名字,加个前缀什么的

ashuicoder avatar Aug 24 '22 03:08 ashuicoder