v-鐢熷懡鍛ㄦ湡

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了v-鐢熷懡鍛ㄦ湡相关的知识,希望对你有一定的参考价值。

鏍囩锛?a href='http://www.mamicode.com/so/1/str' title='str'>str   鏍囩   rip   eth   this   set   new   tin   title   

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script src="vue.min.js"></script>
</head>
<body>
<div id="app">
<button @click="destory">destory vm</button>
<p v-show="isshow">helloworld</p>
</div>
<script type="text/javascript">
const vm = new Vue({
el:"#app",
data:{
// 璁﹑鏍囩閲岄潰鐨勬樉绀哄嚭鏉?br /> isshow:true,
},
// 鍒濆鍖栨樉绀轰箣鍚庣珛鍗宠皟鐢?br /> mounted(){
this.intervalId = setInterval(()=>{
console.log(鈥?-----鈥?
this.isshow=!this.isshow
},1000)
},
// 鍦ㄦ浜′箣鍓嶈皟鐢?娆?br /> beforeDestroy(){
// 娓呴櫎瀹氭椂鍣?br /> clearInterval(this.intervalId)
},
methods:{
destory(){
// 骞叉帀vm
this.$destroy()
}
}
})
</script>
</body>
</html>

以上是关于v-鐢熷懡鍛ㄦ湡的主要内容,如果未能解决你的问题,请参考以下文章

娣卞叆鎺㈢┒JVM涔嬬被鍔犺浇涓庡弻浜插娲炬満鍒?/h1>

Spark of 2021锝滃洜涓烘椿鐫€鏈韩灏辨槸绛旀

鍛ㄦ€荤粨

Go 寮€婧愰」鐩?GitHub 瓒嬪娍鍛ㄦ姤 - 20201221

鍛ㄦ湯鎵嬫捀绠$悊绯荤粺(涓€)