サポート
Framework7には、機能検出ライブラリも付属しています。
これは、Framework7クラスのsupport
プロパティ(Framework7.support
)として、および初期化されたアプリインスタンスの同じプロパティ(app.support
)で利用できます。
// If we need it in place where we don't have access to app instance or before we init the app
if (!Framework7.support.touch) {
console.log('No touch support');
}
// After we init the app we can access it as app instance property
var app = new Framework7({ /*...*/ });
if (!app.support.touch) {
console.log('No touch support');
}
getSupport
Framework7をESモジュールで使用する場合は、代わりにgetSupport
ユーティリティを使用する必要があります。
import { getSupport } from 'framework7';
const support = getSupport();
if (!support.touch) {
console.log('No touch support');
}
サポートプロパティ
touch | タッチイベントのサポート(touchstart、touchmove、touchend) |
pointerEvents | ポインターイベントのサポート |
intersectionObserver | Intersection Observerのサポート |
passiveListener | パッシブイベントリスナーのサポート |