Skip to content

Instantly share code, notes, and snippets.

@minskmaz
Created June 13, 2019 00:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save minskmaz/f02ffdcd89fc73c0a2dc9eb45e790ddd to your computer and use it in GitHub Desktop.
Save minskmaz/f02ffdcd89fc73c0a2dc9eb45e790ddd to your computer and use it in GitHub Desktop.
lifecycle events for a V3 single-file router component
<template>
<div class="block">
<a @click="openAlert" class="button">Open Alert</a>
</div>
</template>
<style scoped>
</style>
<script>
export default {
data: function () {
return {
title: "My Special Component",
}
},
methods: {
openAlert: function () {
var self = this.$app.dialog.alert('Hello world!');
},
setMapObject: function(){
console.log("setMapObject");
}
},
//render(){},
beforeCreate(){
console.log("beforeCreate");
},
created(){
console.log("created");
},
beforeMount(){
console.log("beforeMount");
this.map.invalidateSize();
},
mounted(){
console.log("mounted");
},
updated(){
console.log("updated");
},
beforeDestroy(){
console.log("beforeDestroy");
},
destroyed(){
console.log("destroyed");
},
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment