MCPcopy Create free account
hub / github.com/Tencent/kbone / reload

Method reload

packages/miniprogram-render/src/bom/location.js:564–576  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

562 }
563
564 reload() {
565 const window = cache.getWindow(this.$_pageId)
566 let param = ['type=jump', `targeturl=${encodeURIComponent(this.href)}`]
567 if (this.$_search) param.push(`search=${encodeURIComponent(this.$_search)}`)
568 if (this.$_hash) param.push(`hash=${encodeURIComponent(this.$_hash)}`)
569
570 param = '?' + param.join('&')
571
572 const callMethod = window.$$miniprogram.isTabBarPage(this.$_pageRoute) ? 'switchTab' : 'redirectTo'
573 wx[callMethod]({
574 url: `${this.$_pageRoute}${param}`,
575 })
576 }
577
578 replace(value) {
579 // 和直接赋值 location.href 不同,不需要进入 history

Callers 2

location.test.jsFile · 0.80
goMethod · 0.80

Calls 1

isTabBarPageMethod · 0.80

Tested by

no test coverage detected