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. react一个从下往上划出的组件

    2024-06-14 08:30:03       10 阅读
  2. 小程序

    2024-06-14 08:30:03       40 阅读
  3. 鸿蒙:警告

    2024-06-14 08:30:03       28 阅读
  4. CSS<span style='color:red;'>弹</span><span style='color:red;'>窗</span>

    CSS

    2024-06-14 08:30:03      7 阅读
  5. flutter 底部和中间

    2024-06-14 08:30:03       42 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-06-14 08:30:03       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-06-14 08:30:03       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-06-14 08:30:03       18 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-06-14 08:30:03       20 阅读

热门阅读

  1. 保存csv到mysql的通用脚本

    2024-06-14 08:30:03       5 阅读
  2. Shell 输入/输出重定向

    2024-06-14 08:30:03       9 阅读
  3. 人生结果等于思维方式乘以热情乘以能力

    2024-06-14 08:30:03       8 阅读
  4. Spring事务相关

    2024-06-14 08:30:03       6 阅读
  5. 深入理解MyBatis XML配置文件

    2024-06-14 08:30:03       8 阅读
  6. 深入解析Web通信 HTTP、HTTPS 和 WebSocket

    2024-06-14 08:30:03       11 阅读
  7. 阿里云aliyun cli的作用以及安装步骤

    2024-06-14 08:30:03       9 阅读
  8. ffmpeg把视频文件转码为MP4格式

    2024-06-14 08:30:03       6 阅读
  9. 「C系列」C 函数指针/回调函数

    2024-06-14 08:30:03       8 阅读
  10. Linux 如何查看磁盘空间占用

    2024-06-14 08:30:03       5 阅读
  11. 探索微软Edge:新时代的浏览器先锋

    2024-06-14 08:30:03       7 阅读