1. 创建show-page文件夹,创建index.vue页面组件, 使用 web-view 标签

    从url中取参数
    import { getCurrentInstance } from ‘@tarojs/taro’

    	<template>
    		  <web-view :src="srcValue"></web-view>
    	</template>
    	<script>
    		import { getCurrentInstance } from '@tarojs/taro'
    		export default {
    		  data() {
    		    return {
    		      srcValue: ''
    		    }
    		  },
    		  created(){
    		    this.srcValue =  getCurrentInstance().router.params.value
    		  }
    		}
    	</script>
    
  2. 跳转h5页面中的点击事件
    handleClick() {
      Taro.navigateTo({
        url:
          "/pages/show-page/index?value=https://xxx.index.html"
      });
    },
    

更多推荐