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')
		})
	},
			
相关推荐
凯丨4 小时前
AI 蠕虫来了:恶意文档如何通过 Copilot for Word 自我传播?
人工智能·c#·copilot
ms365copilot5 小时前
Copilot研究助手一键完成会议准备
copilot
ms365copilot11 小时前
Word Copilot 上新模型 Claude Opus 5
microsoft·word·copilot
仙宇觉尘16 小时前
【译】Visual Studio Copilot 中更智能的人工智能编辑
人工智能·copilot·visual studio
ms365copilot1 天前
PPT新模型Claude Opus 5
人工智能·microsoft·powerpoint·copilot
ms365copilot3 天前
Copilot笔记本,多文件协同分析
copilot
ms365copilot4 天前
Copilot直接读取Excel,一键生成完整数据汇报PPT
powerpoint·excel·copilot
武雄(小星Ai)4 天前
2026 AI编程工具横评:Trae、Cursor、Copilot、Claude Code实测对比
ai·copilot·cursor·编程工具·trae·claude code·对比评测
咖啡星人k6 天前
MonkeyCode、Cursor、Claude Code 与 Copilot 的选型思路对比
copilot·ai编程·monkeycode