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"
			}
		}
	}

预期效果

相关推荐
一天 24h13 小时前
从单体到分布式:JWT 如何彻底改变 Web 认证系统
前端·分布式
持梦远方13 小时前
Nginx 静态资源挂载与前端部署实战笔记
linux·前端·笔记·nginx
木斯佳13 小时前
前端八股文面经大全:腾讯云智前端一面(2026-05-13)·面经深度解析
前端·状态模式
fanzhonghong13 小时前
javaWeb后端开发之Linux项目部署3和Docker部署1
linux·服务器·前端·docker
拉里呱唧13 小时前
在线可视化HTML编辑器横评:8款拖拽式工具的实测对比
前端·编辑器·html
lihaozecq13 小时前
Agent 开发 Todo 机制设计,让 Agent 拥有规划能力
前端·agent·ai编程
lchcy13 小时前
移动端h5好多兼容性问题啊
前端
KaMeidebaby13 小时前
卡梅德生物技术快报|多肽库筛选:基于全质粒 PCR 的噬菌体文库构建与小分子表位淘选实战
前端·数据库·其他·百度·新浪微博
m0_5027249513 小时前
vue3生成pdf
前端·javascript·vue.js·pdf
@不误正业13 小时前
2026-05-16-多Agent协作框架深度实战-从ReAct到Plan-and-Execute全架构演进
前端·react.js·架构