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')
		})
	},
			
相关推荐
CoderJia程序员甲3 天前
ScholarCopilot:“学术副驾驶“
ai·大模型·copilot·学术论文·学术助手
语言专家7 天前
亲身体验 Copilot Pages:利用人工智能实时整理和优化笔记
人工智能·机器人·copilot
lzq60310 天前
5分钟上手GitHub Copilot:AI编程助手实战指南
github·copilot·ai编程
Ender(弹射回家版)11 天前
Augment Code:下一代AI编程助手,能否超越GitHub Copilot?
github·copilot·ai编程
网络研究院12 天前
微软的 Copilot 现在可以浏览网页并为您执行操作
microsoft·copilot
weixin_3875456415 天前
探索 GitHub Copilot:当 AI 成为你的贴身编码助手
人工智能·github·copilot
一休哥助手20 天前
Copilot完全指南:AI编程助手的革命性实践
copilot·ai编程
SoFlu软件机器人21 天前
从 Copilot 到垂直工具:AI 编程的 “专精特新“ 进化论
人工智能·copilot
新加坡内哥谈技术22 天前
GPT-4o Image
人工智能·深度学习·语言模型·自然语言处理·copilot
新加坡内哥谈技术24 天前
Claude“延展思考extended thinking“
人工智能·深度学习·语言模型·自然语言处理·copilot