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

预期效果

相关推荐
独隅1 分钟前
Chrome插件开发实战详细指南
前端·chrome
VcB之殇2 分钟前
[Three.js] 实现两个3D模型之间的粒子化切换
前端·javascript·three.js
喵了几个咪5 分钟前
技术复盘:基于 GoWind Admin 实现 Kratos 框架单体轻量化落地
前端·架构
ZC跨境爬虫11 分钟前
跟着 MDN 学JavaScript day_6:JavaScript 中的基础数学——数字与运算符
开发语言·前端·javascript·学习·ecmascript
copyer_xyf11 分钟前
Python 迭代器与生成器
前端·后端·python
KaMeidebaby8 小时前
卡梅德生物技术快报|PD1 单克隆抗体定制配套 N 糖全谱质控开发
前端·人工智能·算法·数据挖掘·数据分析
nuIl9 小时前
实现一个 Coding Agent(3):工具调用
前端·agent·cursor
nuIl9 小时前
实现一个 Coding Agent(4):ReAct 循环
前端·agent·cursor
nuIl9 小时前
实现一个 Coding Agent(1):一次 LLM 调用
前端·agent·cursor
nuIl9 小时前
实现一个 Coding Agent(2):让 LLM 流式响应
前端·agent·cursor