diff --git a/README.md b/README.md index 5891b4c..f470b00 100644 --- a/README.md +++ b/README.md @@ -257,6 +257,16 @@ viewport.isLessThan('desktopWide') // Result: true. viewport.isLessThan('mobile') // Result: false. ``` +### `viewport.isLessOrEquals` +- Type: Boolean + +```js +// Example: viewport.breakpoint is "tablet". + +viewport.isLessOrEquals('tablet') // Result: true. +viewport.isLessOrEquals('mobile') // Result: false. +``` + ### `viewport.match` - Type: Boolean diff --git a/playground/pages/index.vue b/playground/pages/index.vue index 7d7a2e5..9d08964 100644 --- a/playground/pages/index.vue +++ b/playground/pages/index.vue @@ -19,6 +19,9 @@

isLessThan{{ $viewport.isLessThan(breakpoint) }}

+

+ isLessOrEquals{{ $viewport.isLessOrEquals(breakpoint) }} +

isGreaterThan{{ $viewport.isGreaterThan(breakpoint) }}

diff --git a/src/runtime/manager.ts b/src/runtime/manager.ts index 56eda74..169b1a7 100644 --- a/src/runtime/manager.ts +++ b/src/runtime/manager.ts @@ -73,6 +73,7 @@ export function createViewportManager(options: ViewportOptions, state: Ref