Last active
October 4, 2020 09:10
-
-
Save Sixl-Daniel/c191dbb42b4f01a60e94547ee57a1e66 to your computer and use it in GitHub Desktop.
Revisions
-
Sixl-Daniel renamed this gist
Oct 4, 2020 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
Sixl-Daniel created this gist
Oct 4, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,40 @@ # config.js const config = { ..., features: { ... }. ... } function feature (name) { return config.features[name] } function parse (value, fallback) { if (typeof value === 'undefined') { return fallback } switch (typeof fallback) { case 'boolean' : return !!JSON.parse(value) case 'number' : return JSON.parse(value) default : return value } } export { config } export default { install (Vue) { Vue.appConfig = config Vue.feature = feature Vue.prototype.$appConfig = config Vue.prototype.$feature = feature } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ # main.js import Vue from 'vue` import configPlugin from '@/config' Vue.use(configPlugin)