Commit 86ae1e10 authored by 罗超's avatar 罗超
parents a7efb8f5 d885ecdb
// pages/webview/webview.js
Page({
/**
* 页面的初始数据
*/
data: {
newsUrl:'https://baike.baidu.com/item/'
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log("options", options)
let that=this;
if (options.name){
let newsUrl = that.data.newsUrl;
newsUrl = newsUrl + options.name;
that.setData({
newsUrl: newsUrl
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"usingComponents": {},
"navigationStyle": "default"
}
\ No newline at end of file
<view>
<web-view src="{{newsUrl}}"></web-view>
</view>
/* pages/webview/webview.wxss */
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment