1.0.2 • Published 6 years ago

vue-pxtorem v1.0.2

Weekly downloads
2
License
MIT
Repository
-
Last release
6 years ago

vue-pxtorem

vue-pxtorem is a plugin for vue.js

how to use

import RemPlugin from 'vue-pxtorem';

Vue.use(RemPlugin, {
  pxToRem?: number // default 75px = 1rem
});

new Vue({...});

Notice this plugin esm format only and it will take effect automatic.

If you want some components disable rem, plz use this.$rem(false) in lifecycle method beforeCreate().

beforeCreate() {
  this.$rem(false);
}

The easy way to transform px2rem, try this postcss plugin postcss-pxtorem.