弹窗跳转链接
parent
ba3cae78e7
commit
dc991c4626
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,41 @@
|
||||
import Taro from "@tarojs/taro";
|
||||
|
||||
import { Component } from "react";
|
||||
import { Block, WebView } from "@tarojs/components";
|
||||
|
||||
// 打开外部页面使用
|
||||
export default class WebViewPage extends Component<any, any> {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
name: "webView",
|
||||
url: "",
|
||||
};
|
||||
}
|
||||
$instance = Taro.getCurrentInstance();
|
||||
|
||||
async onLoad() {}
|
||||
componentDidMount() {}
|
||||
|
||||
componentWillUnmount() {}
|
||||
|
||||
componentDidShow() {
|
||||
this.initData();
|
||||
}
|
||||
|
||||
componentDidHide() {}
|
||||
|
||||
async initData() {
|
||||
console.log("this.$instance.router", this.$instance.router);
|
||||
this.setState({ url: this.$instance.router?.params?.url });
|
||||
}
|
||||
|
||||
render() {
|
||||
let { url } = this.state;
|
||||
return (
|
||||
<Block>
|
||||
<WebView src={url}></WebView>
|
||||
</Block>
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue