fix(tabs-mf): beforeLeave trigger twice (#4191)

This commit is contained in:
申君健 2026-04-22 15:10:55 +08:00 committed by GitHub
parent a606236274
commit f314981f46
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 4 deletions

View File

@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx --no-install commitlint --edit
# 兼容node25
pnpm exec commitlint --edit

View File

@ -1,4 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx lint-staged
# 兼容node25
pnpm exec lint-staged

View File

@ -6,7 +6,7 @@ import { fastdom } from '@opentiny/utils'
export const setActive =
({ state, api }) =>
(name) => {
const current = state.currentItem ? state.currentItem.name : ''
const current = state.cacheCurrentItem ? state.cacheCurrentItem.name : ''
if (current && current !== name) {
api.canLeave(name, current).then((result) => {