-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(iframe): 新增iframe菜单缓存,切换tab时不再重新加载第三方网页 (#465)
- Loading branch information
Showing
10 changed files
with
76 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/** | ||
* MineAdmin is committed to providing solutions for quickly building web applications | ||
* Please view the LICENSE file that was distributed with this source code, | ||
* For the full copyright and license information. | ||
* Thank you very much for using MineAdmin. | ||
* | ||
* @Author X.Mo<[email protected]> | ||
* @Link https://github.com/mineadmin | ||
*/ | ||
const useIframeKeepAliveStore = defineStore( | ||
'useIframeKeepAliveStore', | ||
() => { | ||
const iframeList = ref<string[]>([]) | ||
|
||
function add(name: string | string[]) { | ||
if (typeof name === 'string') { | ||
!iframeList.value.includes(name) && iframeList.value.push(name) | ||
} | ||
else { | ||
name.forEach((v) => { | ||
v && !iframeList.value.includes(v) && iframeList.value.push(v) | ||
}) | ||
} | ||
} | ||
|
||
function remove(name: string | string[]) { | ||
if (typeof name === 'string') { | ||
iframeList.value = iframeList.value.filter((v) => { | ||
return v !== name | ||
}) | ||
} | ||
else { | ||
iframeList.value = iframeList.value.filter((v) => { | ||
return !name.includes(v) | ||
}) | ||
} | ||
} | ||
|
||
function clean() { | ||
iframeList.value = [] | ||
} | ||
|
||
return { | ||
iframeList, | ||
add, | ||
remove, | ||
clean, | ||
} | ||
}, | ||
) | ||
|
||
export default useIframeKeepAliveStore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters