Add a mixin to be able to fetch the values from CSS variables.
This commit is contained in:
parent
5ac6e47cb2
commit
4b9a978d28
1 changed files with 10 additions and 0 deletions
10
src/main.js
10
src/main.js
|
|
@ -3,6 +3,16 @@ import App from './App.vue';
|
|||
|
||||
Vue.config.productionTip = false;
|
||||
|
||||
// global mixings
|
||||
Vue.mixin({
|
||||
methods: {
|
||||
css_var(var_name) {
|
||||
return getComputedStyle(document.documentElement).getPropertyValue(var_name);
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// eslint-disable-next-line
|
||||
const app = new Vue({
|
||||
render: h => h(App),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue