VUE鼠標移上去提示功能類似hover


首先是CSS

*{margin:0;padding:0}
		fieldset{
			width: 230px;
			padding:30px;
			margin:100px auto;
		}
		fieldset p{
			line-height: 40px;
		}
		fieldset label{
			font-size: 12px;
			color:#bbb;
			vertical-align:3px;
		}
		fieldset input[type="button"]{
			padding-left:5px;
			padding-right:5px;
		}
		fieldset span{
			width:190px;
			padding:5px;
			position:absolute;
			left:0px;
			top:28px;
			border: 1px solid #dfb86d;
			background-color: #fffde4;
			font-size: 12px;
			line-height: 20px;
			color:#dc9632;
		}
		#demo{
			position:relative;
		}

  然后是HTML

	<fieldset>
		<form action="">
			<p>郵箱:<input type="text"></p>
			<p>密碼:<input type="password" name="" id=""></p>
			<p id="demo" v-on:mouseenter="visible" @mouseleave="invisible"><input type="checkbox" id="miandenglu"><label for="miandenglu">十天內免登錄</label>
				<span v-show="seen">為了您的信息安全,請不要在網吧或者公用電腦上使用此功能!</span>
			</p>
			<p>
			<input type="button" value="登 錄">
			<input type="button" value="去注冊">
			</p>
		</form>
	</fieldset>

  最后是VUE

		var app= new Vue({
			el:'#demo',
			data:{
				seen:false
			},
			methods:{
				visible:function(){
					this.seen = true;
				},
				invisible:function(){
					this.seen = false;
				}
			}
		});

  

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM