웹/Vue
라이프 사이클
송민준
2020. 1. 31. 15:05
index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Vue Sample</title>
</head>
<body>
<div id="app">
{{ message }}
</div>
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.2/dist/vue.js"></script>
<script>
new Vue({
el: '#app',
data : {
message : 'Hello Vue.js!'
},
beforeCreate: function() {
console.log("beforeCreate");
},
created: function() {
console.log("created");
},
mounted: function() {
console.log("mounted");
this.message = "Hello Vue!";
},
updated: function() {
console.log("updated");
}
});
</script>
</body>
</html>
Main.vue
<template lang="html">
</template>
<script>
export default {
}
</script>
<style lang="css" scoped>
</style>