File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed
docs/.vitepress/components Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,25 @@ onMounted(async () => {
9898 }),
9999 });
100100 macos_selected_link .value = macos_links .value [0 ];
101+
102+ // 判断是否为微信浏览器
103+ function isWeChatBrowser() {
104+ const userAgent = navigator .userAgent .toLowerCase ();
105+ return userAgent .includes (" micromessenger" );
106+ }
107+
108+ // 获取 <a> 标签并动态修改行为
109+ document .addEventListener (" DOMContentLoaded" , () => {
110+ const link = document .getElementById (" app-store-link" );
111+
112+ if (isWeChatBrowser ()) {
113+ // 如果是微信浏览器,阻止默认跳转行为
114+ link ?.addEventListener (" click" , (event ) => {
115+ event .preventDefault (); // 阻止默认跳转
116+ window .location .href = " https://apps.apple.com/cn/app/6443558874" ; // 可选:尝试强制跳转
117+ });
118+ }
119+ });
101120});
102121 </script >
103122
@@ -157,7 +176,11 @@ onMounted(async () => {
157176 <span class =" platform-label" >iOS</span >
158177 </div >
159178 <div class =" download-btn" >
160- <a href =" https://apps.apple.com/cn/app/6443558874" target =" _blank" >
179+ <a
180+ id =" app-store-link"
181+ href =" https://apps.apple.com/cn/app/6443558874"
182+ target =" _blank"
183+ >
161184 App Store @Dweb Browser
162185 </a >
163186 </div >
You can’t perform that action at this time.
0 commit comments