detector-device-type
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

📱 device-detector

一个轻量级设备类型检测库,支持 Vue 2 / Vue 3、React、Umi、原生 HTML/JS。

✨ 使用示例

1. Vue/React 中导入

import { getDeviceInfo } from 'detector-device-type';
const info = getDeviceInfo();
console.log(info.deviceType); // 'ipad' / 'mac' / 'android-phone' 等

2. 原生 HTML 页面

<script src="detector-device-type.mjs"></script>
<script>
  const info = window.getDeviceInfo();
  console.log(info.deviceType);
</script>

Readme

Keywords

Package Sidebar

Install

npm i detector-device-type

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

7.31 kB

Total Files

9

Last publish

Collaborators

  • youmy