Skip to content

Instantly share code, notes, and snippets.

@MinSomai
Created December 28, 2021 07:02
Show Gist options
  • Save MinSomai/078816275eff21f519f79cae0cc24cf6 to your computer and use it in GitHub Desktop.
Save MinSomai/078816275eff21f519f79cae0cc24cf6 to your computer and use it in GitHub Desktop.
Vuetify - make components global
<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