uniapp 仿写弹窗

页面

复制代码
<template>
	<view @click="close" class="mask">
		<view @click.stop="onClick" class="content">
			<text class="text">点击蒙层关闭</text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		methods: {
			onClick(e) {
				uni.showToast({
					title: "点击蒙层关闭"
				})
				// #ifdef APP-NVUE
				e.stopPropagation()
				// #endif
			},
			close() {
				uni.navigateBack()
			}
		}
	}
</script>

<style>
	page {
		background: transparent;
	}

	.mask {
		position: fixed;
		left: 0;
		top: 0;
		right: 0;
		bottom: 0;
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		justify-content: center;
		align-items: center;
		background-color: rgba(0, 0, 0, 0.4);
	}

	.content {
		width: 200px;
		height: 200px;
		background-color: #007AFF;
	}

	.text {
		/* #ifndef APP-NVUE */
		display: block;
		/* #endif */
		line-height: 200px;
		text-align: center;
		color: #FFFFFF;
	}
</style>

manifest.json 配置

复制代码
	{
		"path": "pages/popup/popup",
		"style": {
			"navigationStyle": "custom",
			"backgroundColor": "transparent",
			"app-plus": {
				"animationType": "fade-in",
				"background": "transparent",
				"popGesture": "none"
			}
		}
	}

预期效果

相关推荐
Coodor5 分钟前
使用web也可以写NFC微信小程序拉取
前端·微信小程序·小程序·nfc拉起小程序
Wang's Blog1 小时前
Vibe Coding一人即团队系列28: 前端、后端与数据库的概念解析
前端·数据库
Dovis(誓平步青云)1 小时前
模拟器横评:电脑上看小说、追短剧用什么模拟器?MuMu、雷电、腾讯手游助手实测
android·java·服务器·前端·javascript·电脑
踩蚂蚁1 小时前
把自定义唤醒词部署到 ESP32-S3:ONNX 转 INT8 TFLite 的完整链路
前端
前端繁华如梦1 小时前
用 Vite + Electron + React + Python 重造 3D 服装打版软件
前端
豆沙沙包?1 小时前
函数重载/类和对象(P14-P60)
前端·算法
三十而立洋2 小时前
彻底搞懂跨域:原理、CORS、解决方案与实战避坑
前端
计算机魔术师2 小时前
ASR转录总出错?Google新模型WER降到2.6%,还能自动帮你改口误
前端
xcs194052 小时前
新版 IDEA(尤其是 2024/2025/2026)越来越臃肿
前端·人工智能·intellij-idea