2.1.3 • Published 5 years ago

@averjs/responsive-helper v2.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

Responsive Helper

This package is a helper component to determine Bootstrap 4 breakpoints in Vue.js.

Installation

To install the package use one of the following commands:

npm install @averjs/responsive-helper
# OR
yarn add @averjs/responsive-helper

Usage

Register the plugin:

import Vue from 'vue';
import ResponsiveHelper from '@averjs/responsive-helper';

Vue.use(ResponsiveHelper);

Implement it in eg. App.vue:

<template>
    <div id="app">
        <responsive-helper />
        <span v-text="bp"></span>
    </div>
</template>

<script>
    export default {
        computed() {
            bp() {
                return this.$bp.currentBreakpoint();
            }
        }
    }
</script>

The component adds a instance property called $bp. It exposes 3 Methods described below. By wrapping those methods inside a computed property you can make use of reactivity, like shown above.

Options

  • name String (optional) The name for the component.

Props

Methods

down

Checks if the passed breakpoint is smaller or equal the given breakpoint.

  • bp String (required)
    You can pass a string with the breakpoint you want to check.

  • equals Boolen (optional) Default: true
    Set to false if you dont want the given breakpoint to be included in calculation.

up

The same as down but the other way.

currentBreakpoint

Returns the current breakpoint which is set when the window gets resized.

2.1.3

5 years ago

2.1.2

5 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.0

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago