svelte device detector
0.2.2
••
さまざまなデバイスタイプのビューをレンダリングします。
npm i svelte-device-detector
// OR
yarn add svelte-device-detector
注:このライブラリをSapperで使用するには、dev依存性としてインストールします。リンクを参照してください。
ローカルデモ:
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としてライセンスされているオープンソースソフトウェアです。