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')
		})
	},
			
相关推荐
谅望者10 小时前
从 GitHub Copilot 到 Claude Code:AI 编码的 3 年演变之旅
人工智能·github·copilot
Leinwin4 天前
智能体驱动业务转型:Microsoft Copilot Studio平台全面升级
人工智能·microsoft·copilot
Kaze-14 天前
VSCode Copilot无法连接网络的解决过程
ide·vscode·copilot
青瓷看世界4 天前
鸿蒙开发时AI编程工具codeGenie与Github Copilot的区别
github·copilot·ai编程·harmonyos·codegenie
Leinwin8 天前
Ignite 2025:Microsoft 365 Copilot 全面升级,引领企业进入自主智能(Agentic AI)新时代
人工智能·microsoft·copilot
MicrosoftReactor14 天前
技术速递|GitHub Copilot CLI:快速上手指南
github·copilot
std8602117 天前
微软升级Copilot Actions,可对本地文件执行操作
microsoft·copilot
硬汉嵌入式21 天前
专为 MATLAB 优化的 AI 助手MATLAB Copilot
人工智能·matlab·copilot
MicrosoftReactor23 天前
技术速递|GitHub Copilot 和 AI Agent 如何拯救传统系统
人工智能·github·copilot·agent
500佰24 天前
Copilot、Codeium 软件开发领域的代表性工具背后的技术
人工智能·github·gpt-3·copilot·个人开发·xcode