From 4642a18c955e4b393a222facb889f3d91fa5ed91 Mon Sep 17 00:00:00 2001 From: whycq <913841844@qq.com> Date: 星期六, 04 十一月 2023 00:23:16 +0800 Subject: [PATCH] # --- uni_modules/uni-swipe-action/components/uni-swipe-action-item/isPC.js | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/uni_modules/uni-swipe-action/components/uni-swipe-action-item/isPC.js b/uni_modules/uni-swipe-action/components/uni-swipe-action-item/isPC.js new file mode 100644 index 0000000..9a10ece --- /dev/null +++ b/uni_modules/uni-swipe-action/components/uni-swipe-action-item/isPC.js @@ -0,0 +1,12 @@ +export function isPC() { + var userAgentInfo = navigator.userAgent; + var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"]; + var flag = true; + for (let v = 0; v < Agents.length - 1; v++) { + if (userAgentInfo.indexOf(Agents[v]) > 0) { + flag = false; + break; + } + } + return flag; +} \ No newline at end of file -- Gitblit v1.9.1