vue-temperature-filter
v0.1.0
Published
Pluging filter temperature by Nicolas Nimetz
Downloads
2
Readme
eslint-plugin-nnimetz
Plugin temperature for Vue.js 2.*
Installation
Install vue-temperature-filter
:
$ yarn add vue-temperature-filter --dev
Or
$ npm install vue-temperature-filter --save-dev
Usage
Import plugin in main.js
import Vue from 'vue';
import VueTemperatureFilter from 'vue-temperature-filter';
// Use Plugins
Vue.use(VueTemperatureFilter);
// Add Global Configuration
Vue.use(VueTemperatureFilter, {
fromFahrenheit: true,
showText: true
});
Use in view
// Convert 15˚ Fahrenheit to Celsius
{{ 15 | temperature }}
// Convert 15˚ Celsius to Fahrenheit
{{ 15 | temperature(false) }}
// Convert 15˚ Fahrenheit to Celsius and add display C
{{ 15 | temperature(true, true) }}