<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="vue.js"></script>
</head>
<body>
<div id="app" ref="app">
{
{ name }}
</div>
</body>
<script>
let vm=new Vue({
el:"#app",
data:{
name:"liuting",
},
beforeCreate(){
console.log("创建前:");
console.log(this.$el);
console.log(this.$data);
},
created(){
console.log("创建完成:");
console.log(this.$el);
console.log(this.$data);
},
beforeMount(){
console.log("挂载前:");
console.log(this.$el);
【vue.js】生命周期——beforeCreate、created、beforeMount、mounted、beforeUpdate、updated、beforeDesotry、destoryed
最新推荐文章于 2024-06-21 00:48:08 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)