码迷,mamicode.com
首页 > 其他好文 > 详细

5.9虚拟dom

时间:2020-04-15 21:27:35      阅读:76      评论:0      收藏:0      [点我收藏+]

标签:body   dom   com   tle   text   this   rip   script   method   

技术图片

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<title>Title</title>

<script src="../../js/vue.js"></script>

</head>

<body>

<div id="app">

<p v-if="isAccountLogIn">账号登录<input type="text" id="accountLogIn" key="account"/></p>

<p v-else="!isAccountLogIn">邮箱登录<input type="text" id="emailLogIn" key="email"/></p>

<button @click="logInSwitch()">切换登录方式</button>

</div>

<script>

const vm = new Vue({

el: ‘#app‘,

data: {

isAccountLogIn: true

},

methods: {

logInSwitch() {

this.isAccountLogIn = !this.isAccountLogIn;

}

}

});

</script>

</body>

</html>

5.9虚拟dom

标签:body   dom   com   tle   text   this   rip   script   method   

原文地址:https://www.cnblogs.com/edfg/p/12708344.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!