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')
		})
	},
			
相关推荐
ζั͡山 ั͡有扶苏 ั͡✾14 小时前
AI辅助编程工具对比分析:Cursor、Copilot及其他主流选择
人工智能·copilot·cursor
Leinwin14 小时前
ContextIQ 上线:助力 Copilot 深度洞察你的工作场景
copilot
不坑老师15 小时前
利用不坑盒子的Copilot,快速排值班表
microsoft·word·powerpoint·excel·copilot·wps
清风细雨_林木木15 天前
GitHub Copilot 配置快捷键
github·copilot
清风细雨_林木木15 天前
GitHub Copilot 是什么,怎么使用
github·copilot
Elastic 中国社区官方博客17 天前
使用 Elasticsearch 提升 Copilot 能力
大数据·数据库·elasticsearch·搜索引擎·全文检索·copilot·mcp
崔鹏飞18 天前
如何给 GitHub Copilot "洗脑”,让 AI 精准遵循指令产出高质量代码
copilot
南菠湾21 天前
How to set up SSH, Git and Copilot Extensions in Visual Studio Code
git·ssh·copilot
Leinwin22 天前
微软Copilot两大创新功能详解:SharePoint Agents vs. Copilot Notebooks
microsoft·copilot·sharepoint
黑码哥25 天前
Copilot for Xcode (iOS的 AI辅助编程)
人工智能·copilot·ai编程·xcode·ai辅助编程