uniapp 微信小程序 内嵌H5网页办法

uniapp 微信小程序 内嵌H5网页办法

如图所示

1.新建webView页面

html 复制代码
<template>
	<web-view v-if='httpUrl' :src='httpUrl'></web-view>
</template>

<script>
	export default {
		data() {
			return {
				httpUrl: "",
			};
		},
		onLoad(options) {
			options.httpUrl = decodeURIComponent(options.httpUrl);
			this.httpUrl = options.httpUrl;
		},
		methods: {},
	};
</script>

<style>
</style>

2.跳转页面

javascript 复制代码
// 页面跳转
	toPage(url) {
		uni.navigateTo({
			url: '/pages/PageWebview?httpUrl=' + encodeURIComponent('https://www.baidu.com')
		})
	},
			
相关推荐
Leinwin3 小时前
Claude Fable 5.1 上线 Copilot Studio:能力定位、访问策略配置与 Work IQ 上下文
copilot
ms365copilot5 小时前
Excel Copilot一键美化图表,无需手动调格式
excel·copilot·outlook
白帽黑客-晨哥7 小时前
Copilot 能换成本地吗?本地化 AI 编程助手完全指南
数据库·人工智能·copilot
天天喝旺仔1 天前
AI 编程实战:用 Cursor + Claude Code + Copilot 把效率翻倍
ide·chatgpt·prompt·copilot·ai编程
ms365copilot1 天前
Copilot Planner Agent生成【机器人产品发布全计划】
机器人·copilot
ms365copilot1 天前
OneDrive Copilot 从图像获取见解,读懂图表、示意图
人工智能·copilot·onedrive
ms365copilot2 天前
OneDrive Copilot四大能力|总结、对比、问答、音频概述,云端处理文件不用打开
copilot·onedrive
ms365copilot2 天前
用 Outlook Copilot 搭建「发票归档系统」
copilot·outlook
其实防守也摸鱼2 天前
OpenClaw Windows 踩坑实战指南
运维·服务器·数据库·windows·github·copilot
该逃避避2 天前
Copilot 能换成本地吗?本地化 AI 编程助手可行性全解析
人工智能·copilot