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')
		})
	},
			
相关推荐
500佰2 小时前
Copilot、Codeium 软件开发领域的代表性工具背后的技术
人工智能·github·gpt-3·copilot·个人开发·xcode
Blossom.1181 天前
AI Agent记忆系统深度实现:从短期记忆到长期人格的演进
人工智能·python·深度学习·算法·决策树·机器学习·copilot
mrsyf9 天前
VSCode中Copilot的询问、编辑、代理有啥区别?
ide·vscode·copilot
诗水人间9 天前
可替代Github Copilot的插件分享CodeGeeX
copilot·ai工具·codegeex
稚麟10 天前
GitHub Copilot CLI: How to get started
github·copilot
wwlsm_zql13 天前
微软Copilot+企业版亮相:GPT-5赋能,效率激增47%,多模态操控金融级安全
人工智能·gpt·microsoft·copilot
不老刘16 天前
Microsoft 365 Copilot 扩展至应用和工作流构建功能
microsoft·copilot·ai编程
dwedwswd16 天前
技术速递|从 0 到 1:用 Playwright MCP 搭配 GitHub Copilot 搭建 Web 应用调试环境
前端·github·copilot
2501_9387738716 天前
技术速递|解锁 Playwright MCP 高级调试:GitHub Copilot 辅助生成动态元素定位脚本
github·copilot
2501_9387742916 天前
Copilot 与测试工具协同?Mastering 课程中单元测试生成与结对编程的结合
测试工具·单元测试·copilot