MCPcopy Create free account
hub / github.com/Tencent/kbone / $$endCheckHash

Method $$endCheckHash

packages/miniprogram-render/src/bom/location.js:380–396  ·  view source on GitHub ↗

* 检查 hash 变化

(needCheckUrlChange)

Source from the content-addressed store, hash-verified

378 * 检查 hash 变化
379 */
380 $$endCheckHash(needCheckUrlChange) {
381 if (!this.$_allowCheck) return
382
383 if ((needCheckUrlChange || (this.$_lastPathname === this.$_pathname && this.$_lastSearch === this.$_search)) && this.$_lastHash !== this.$_hash) {
384 this.$$trigger('hashchange', {
385 event: {
386 oldURL: this.$_lastHref,
387 newURL: this.href,
388 }
389 })
390 }
391
392 this.$_lastHash = ''
393 this.$_lastPathname = ''
394 this.$_lastSearch = ''
395 this.$_lastHref = ''
396 }
397
398 /**
399 * 对外属性和方法

Callers 3

hashMethod · 0.95
goMethod · 0.80

Calls 1

$$triggerMethod · 0.45

Tested by

no test coverage detected