global component vue code example
Example 1: vue import component
<template>
<Btn />
</template>
<script>
import Btn from './components/Btn'
export default {
components: { Btn },
}
</script>
Example 2: how to create a global variable in vue
// in main =.js
Vue.prototype.$appName = 'My App'
////in components
console.log(this.$appName)