1.0.4 • Published 4 years ago

@apility/vue-breakpoints v1.0.4

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

vue-breakpoints

A Vue.js plugin providing a reactive object reflecting breakpoint states

Install

yarn add @apility/vue-breakpoints
import Vue from 'vue'
import VueBreakpoints from '@apility/vue-breakpoints'

// With default options
Vue.use(VueBreakpoints)

// With custom options
Vue.use(VueBreakpoints, {
  breakpoints: {
    ...
  },
  useRem: true
})

Usage

...
<h1 v-if="bp.md">I'll show up on breakpoints md and above</h1>
<h1 v-else>I'll show up on breakpoints smaller than md</h1>

<h2 v-if="bp.breakpoint === 'md'">I'll only show up on the breakpoint md</h2>
...

Options

breakpoints

The breakpoints option is an object where the keys are breakpoint names, and the values are breakpoint min-width value

The default is:

{
  xs: 0, sm: 36, md: 48, lg: 62, xl: 75
}

useRem

The useRem option is a boolean value denoting whether the breakpoint values units are rem or px

The default is: true

1.0.4

4 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