From f17e29309ad987015e4513e02a3714365437ff82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B9=9D=E6=97=AC=E5=A4=A7=E7=88=B7=E7=9A=84=E6=A2=A6?= Date: Tue, 8 Dec 2020 15:25:55 +0800 Subject: [PATCH] Update link.ts (#3821) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(mixins): 页面栈上限后导致的跳转失败 --- example/components/demo-home-nav/index.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/example/components/demo-home-nav/index.js b/example/components/demo-home-nav/index.js index 07508d5f..648cff6f 100644 --- a/example/components/demo-home-nav/index.js +++ b/example/components/demo-home-nav/index.js @@ -1,13 +1,16 @@ Component({ properties: { - group: Object + group: Object, }, methods: { onClick(event) { - wx.navigateTo({ - url: event.target.dataset.url - }); - } - } + const { url } = event.target.dataset; + if (getCurrentPages().length > 9) { + wx.redirectTo({ url }); + } else { + wx.navigateTo({ url }); + } + }, + }, });