一:使用switchTab跳轉(zhuǎn)后頁面不刷新的問題
分享者:yonggeit,原文地址
-
wx.switchTab({
-
url: '../index/index',
-
success: function (e) {
-
var page = getCurrentPages().pop();
-
if (page == undefined || page == null) return;
-
page.onLoad();
-
}
-
})
switchTab成功跳轉(zhuǎn)后調(diào)用success,此時(shí)可以拿到跳轉(zhuǎn)后頁面的page對(duì)象,從而調(diào)用頁面onLoad方法重載頁面;微信后期應(yīng)該會(huì)加相應(yīng)的參數(shù)來決定是否刷新跳轉(zhuǎn)
二:Html轉(zhuǎn)Json轉(zhuǎn)Wxml
分享者:小春,原文地址 wxml
-
<view class="newsContainer">
-
<import src="../../utils/wxParse/wxParse.wxml" />
-
<template is="wxParse" data="{{wxParseData:content.nodes}}" />
-
</view>
js
-
var WxParse = require('../../utils/wxParse/wxParse.js')
-
-
onShow: function () {
-
var that = this
-
utils_news.GetNewsSingle(clippingsId, function (result) {
-
WxParse.wxParse('content', 'html', result.content, that, 1);
-
})
-
}
|