The uniapp project is embedded in other web pages

-- This h5 page cannot be a local page. The h5 page written by myself can be placed on the server or jumped to other official websites, in short, it cannot be a local address --

1. Create a new page, you can set the width and height for the web-view

//新创建的页面
<template>
	<view>
		<!-- 跳转外部网页 -->
		<web-view  src="www.baidu.com"></web-view>
	</view>
</template>
<script></script>
<style></style>

 2. Configure the path in pages.json

//pages.json配置的路径,outWebSite是刚才创建的页面
        {
            "path" : "pages/outWebSite",
            "style" :                                                                                    
            {
                "navigationBarTitleText": "",
                "enablePullDownRefresh": false
            }
            
        }

3. Jump to this page

				uni.navigateTo({
					url: 'pages/outWebSite',
				})

Guess you like

Origin blog.csdn.net/qq_68155756/article/details/130241661