分享者:yonggeit,原文地址
wx.switchTab({
url: '../index/index',
success: function (e) {
var page = getCurrentPages().pop();
if (page == undefined || page == null) return;
page.onLoad();
}
})
switchTab成功跳转后调用success,此时可以拿到跳转后页面的page对象,从而调用页面onLoad方法重载页面;微信后期应该会加相应的参数来决定是否刷新跳转
二:Html转Json转Wxml
分享者:小春,原文地址 wxml
<view class="newsContainer">
<import src=http://www.yiyongtong.com/archives/"../../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);