小程序 web-view
小程序 web-view
https://opendocs.alipay.com/mini/component/web-view
https://opendocs.alipay.com/mini/api/webview-context
https://opensupport.alipay.com/support/knowledge/46919/201602349122?ant_source=zsearch
https://opensupport.alipay.com/support/helpcenter/190
https://opendocs.alipay.com/search?keyword=web view&pageIndex=1&pageSize=10&type=qa
webview
- Open H5 url
if (replace) {
Taro.redirectTo({
url,
})
} else {
Taro.navigateTo({
url,
})
}
- web-view component with H5 url ??? auto render bug
open iframe page (taro router) ???
// import Taro, { Component } from '@tarojs/taro'
import Taro, { Component, Config } from '@tarojs/taro'
import {
View,
Text,
WebView,
} from '@tarojs/components'
import './index.scss'
// import classNames from 'classnames'
// import PropTypes, { InferProps } from 'prop-types'
const log = console.log;
export default class IframeComponent extends Component {
config = {
navigationBarTitleText: '购买须知'
}
constructor (props) {
super(props)
const {
url,
} = props
this.state = {
link: url || ``,
};
}
componentWillReceiveProps(nextProps) {
const {
url,
} = nextProps;
if (url !== this.state.link) {
this.setState({
link: url || ``,
})
}
}
componentWillMount () { }
componentDidMount () { }
componentWillUnmount () { }
componentDidShow () { }
componentDidHide () { }
stopDefaultEvent = (e) => {
e.preventDefault();
e.stopPropagation();
return;
}
render () {
// const {
// link,
// } = this.state;
const {
url,
} = this.props;
return (<WebView className='iframe-container' src={link} onMessage={this.stopDefaultEvent} />);
// const {
// url,
// } = this.props;
// return (<WebView className='iframe-container' src={url} onMessage={this.stopDefaultEvent} />);
}
}
IframeComponent.defaultProps = {
url: '',
}
xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!
小程序 web-view的更多相关文章
- 一套代码小程序&Web&Native运行的探索05——snabbdom
接上文:一套代码小程序&Web&Native运行的探索04——数据更新 对应Git代码地址请见:https://github.com/yexiaochai/wxdemo/tree/ma ...
- 一套代码小程序&Web&Native运行的探索04——数据更新
接上文:一套代码小程序&Web&Native运行的探索03 对应Git代码地址请见:https://github.com/yexiaochai/wxdemo/tree/master/m ...
- 一套代码小程序&Web&Native运行的探索02
接上文:一套代码小程序&Web&Native运行的探索01,本文都是一些探索性为目的的研究学习,在最终版输出前,内中的内容可能会有点乱 参考: https://github.com/f ...
- 小程序 web 端实时运行工具
微信小程序 web 端实时运行工具 https://chemzqm.github.io/wept/
- 一套代码小程序&Web&Native运行的探索06——组件系统
接上文:一套代码小程序&Web&Native运行的探索05——snabbdom 对应Git代码地址请见:https://github.com/yexiaochai/wxdemo/tre ...
- 一套代码小程序&Web&Native运行的探索03——处理模板及属性
接上文:一套代码小程序&Web&Native运行的探索02 对应Git代码地址请见:https://github.com/yexiaochai/wxdemo/tree/master/m ...
- 一套代码小程序&Web&Native运行的探索07——mpvue简单调研
前言 接上文:[一套代码小程序&Native&Web阶段总结篇]可以这样阅读Vue源码 最近工作比较忙,加之上个月生了小孩,小情人是各种折腾他爸妈,我们可以使用的独立时间片不多,虽然这 ...
- 原创:微信小程序+WEB使用JS实现注册【60s】倒计时功能
1.效果图: 2.页面仅仅利用了JS的相关功能,包含:wxml.js.wxss 2.1wxml页面代码: <text>绑定手机</text> <form bindsubm ...
- 小程序web开发框架-weweb介绍
weweb是一个兼容小程序语法的前端框架,你可以用小程序的写法,来写web单面应用.如果你已经有小程序了,通过它你可以将你的小程序运行在浏览器中.在小程序大行其道的今天,它可以让你的小程序代码得到最大 ...
- 关于微信小程序获取view的动态高度填坑
wx.createSelectorQuery().select('#box').boundingClientRect(function (rect) { width = rect.width heig ...
随机推荐
- Spring Boot中进行Junit测试
Spring Boot新版本默认使用Junit5,pom依赖为: <dependency> <groupId>org.springframework.boot</grou ...
- Excel常见后缀名
1.格式.xlsx:excel2007-2016版默认的文件格式,不能有宏: 2.格式.xls:excel97-2003版,可以有宏: 3.格式.csv:以逗号分隔的文本文件,便于兼容其他程序,只保存 ...
- Spark动态加载外部资源文件
Spark动态加载外部资源文件 1.spark-submit --files 动态加载外部资源文件 之前做一个关于Spark的项目时,因项目中需要读取某个静态资源文件,然后在本地IDEA测试一切皆正常 ...
- ipython和jupyter安装
ipython pip install ipython pip install --upgrade pip jupyter pip install jupyter 查看token: jupyter n ...
- SpringApplication.run
SpringApplication.run一共做了两件事,分别是 创建SpringApplication对象 利用创建好的SpringApplication对象,调用run方法 1.创建SpringA ...
- sql语句定义和执行顺序
sql语句定义的顺序 (1) SELECT (2)DISTINCT<select_list> (3) FROM <left_table> (4) <join_type&g ...
- HDU6703 array (线段树)
题意:长为1e5的全排列 有两个操作 把一个数删掉 询问1,r这个区间内 找到一个数大于等于x 且这个数不等于区间内的所有数 题解:建一颗权值线段树 线段树里存值为i的数在原数组中的坐标 维护坐标的最 ...
- Codeforces Round #644 (Div. 3)
比赛链接:https://codeforces.com/contest/1360 A - Minimal Square 题意 计算能包含两个 $a \times b$ 矩形的最小正方形的面积. 题解 ...
- poj 1113 wall(凸包裸题)(记住求线段距离的时候是点积,点积是cos)
Wall Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 43274 Accepted: 14716 Descriptio ...
- AcWing 243. 一个简单的整数问题2 (树状数组,区间更新/询问)
题意:区间更新,区间询问. 题解;对于区间更新,我们还是用差分数组\(b_i\)来更新,区间询问时,我们的答案是:\(\sum_{i=l}^{r}\sum_{j=1}^{i}b_j\), 所以,我们搞 ...