Created
June 29, 2020 03:03
-
-
Save saboyutaka/a2a26afca4aac3c4d03c7e0d64b07805 to your computer and use it in GitHub Desktop.
Nuxt helper
This file contains 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 characters
# lib/helpers.js | |
module.exports = { | |
appName: () => { | |
return process.env.APP_NAME; | |
}, | |
}; |
This file contains 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 characters
# plugins/helpers.js | |
import Vue from 'vue'; | |
import helpers from '~/lib/helpers'; | |
const plugin = { | |
install() { | |
Vue.helpers = helpers; | |
Vue.prototype.$helpers = helpers; | |
}, | |
}; | |
Vue.use(plugin); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment