Created
December 28, 2021 07:02
-
-
Save MinSomai/078816275eff21f519f79cae0cc24cf6 to your computer and use it in GitHub Desktop.
Vuetify - make components global
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
<template> | |
<v-app> | |
<!-- other components ... --> | |
<confirm ref="confirm"></confirm> | |
</v-app> | |
</template> | |
<script> | |
import confirm from "./components/confirm.vue"; | |
export default{ | |
components: { | |
confirm, | |
}, | |
mounted() { | |
this.$root.$confirm = this.$refs.confirm; | |
// now you can access your confirm component from any components | |
// this.$root.$confirm | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment