svelte device detector
0.2.2
• • •
다른 장치 유형에서보기를 렌더링합니다.
npm i svelte-device-detector
// OR
yarn add svelte-device-detector
참고 : Sapper 에서이 라이브러리를 사용하려면 DevDependency로 설치하십시오. 링크를 참조하십시오.
로컬 데모 :
git clone https://github.com/andrelmlins/svelte-device-detector.git
cd svelte-device-detector
npm install && npm run dev
라이브러리 사용 방법의 예 :
< script >
import DeviceDetector from "svelte-device-detector";
</ script >
< DeviceDetector showInDevice = "desktop" >
< p > Desktop </ p >
< / DeviceDetector>
< DeviceDetector showInBrowser = "chrome" showInDevice = "mobile" >
< p > Mobile and Chrome </ p >
</ DeviceDetector >
< DeviceDetector showInBrowser = { [ "safari" , "firefox" ] } >
< p > Safari or Firefox </ p >
< / DeviceDetector>최상의 결과를 위해 값에는 이러한 특성이 있습니다.
| 소품 | 기본 | 유형 | 설명 |
|---|---|---|---|
| showindevice | - | string , array | 장치 유형에서보기를 렌더링하십시오 |
| ShowInbrowser | - | string , array | 브라우저 유형에서보기를 렌더링하십시오 |
| Showinos | - | string , array | 운영 체제 유형에서보기를 렌더링하십시오 |
이 NPM 패키지의 통계를 다운로드하십시오
Svelte Device Detector는 MIT로 라이센스가 부여 된 오픈 소스 소프트웨어입니다.