Taro框架-微信小程序-内嵌h5页面
·
- 创建
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> - 跳转h5页面中的点击事件
handleClick() { Taro.navigateTo({ url: "/pages/show-page/index?value=https://xxx.index.html" }); },
更多推荐



所有评论(0)