最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

vue實(shí)現(xiàn)登錄、注冊、退出、跳轉(zhuǎn)等功能

 更新時(shí)間:2020年12月23日 11:08:11   作者:學(xué)習(xí)永遠(yuǎn)不會晚  
這篇文章主要介紹了vue實(shí)現(xiàn)登錄、注冊、退出、跳轉(zhuǎn)等功能,需要的朋友可以參考下

本文給大家介紹vue實(shí)現(xiàn)登錄、注冊、退出、跳轉(zhuǎn)功能,具體代碼如下所示:

效果圖1:

效果圖2:

效果圖3:

效果圖4:

完整實(shí)例:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="GBK">
    <title></title>
    <style>
    ul li {
 
      margin: 0;
      padding: 0;
      list-style: none;
    }
    #app {
      width: 600px;
      height: 400px;
      margin: 0 auto;
      border: 1px solid #ccc;
    }
    .title{
    	text-align:center;
    }
    .tab-tilte{
      width: 99%;
    }
    .tab-tilte li{
      float: left;
      width: 31%;
      padding: 10px 0;
      text-align: center;
      background-color:#f4f4f4;
      cursor: pointer;
    }
   /* 點(diǎn)擊對應(yīng)的標(biāo)題添加對應(yīng)的背景顏色 */
    .tab-tilte .active{
      background-color: #09f;
      color: #fff;
    }
    .tab-content div{
      float: left;
      width: 25%;
      line-height: 100px;
      text-align: center;
    }
    .sider_icon{
				display: inline-block;
				width:36px;
				height:40px;
				line-height:36px;
				font-size:20px;
				text-align:center;
				color:#fff;
				background: url(../images/bubble.png) 0 0 no-repeat;
				top:-20px;
			}
    	.contentli{
    		float: left;
	      padding: 10px 0;
	      text-align: center;
    	}
    	.input{
    		float: left;
    		width: 60%;
    		margin-left:20%;
	      padding: 10px 0;
	      align:center;
    	}
    	.btn{
    		float: left;
	      width: 20%;
	      margin-left:60%;
	      padding: 10px 1px;
	      text-align: center;
    	}
    	.guanggao{
    		float:right;
    		padding-right:10px;
    		cursor:pointer;
    	}
    	#bottomDiv{
    		float: left;
	      margin-left:40%;
	      padding: 10px 10px;
	      text-align: center;
    	}
    	#bottomDiv a{
    			 padding: 1px 10px;
    			 cursor:pointer;
    			 border-bottom:1px solid red;
    	}
    </style>
  </head>
  <body>
  	<div id="app" >
  		<div v-show='page==="advert"'>
  			<span class='guanggao' @click='goLogin'>點(diǎn)擊跳轉(zhuǎn)<b>{{n}}</b></span>
  			
  			<div id='bottomDiv'>
	  			<h1 class='title'>歡迎體驗(yàn)</h1>
	  		</div>
  		</div>
  		<div v-show='page==="login"'>
	  		<div>
	  			<h1 class='title'>歡迎登錄</h1>
	  			<div>
		  			<input type="text" v-model='name' class="input" placeholder='請輸入用戶名'>
		  			<p v-show='!name'>請輸入用戶名</p>
	  			</div>
	  			<div>
	  			<input type="text" v-model='pwd' class="input" placeholder='請輸入密碼'>
	  			<p v-show='!pwd'>請輸入密碼</p>
	  			</div>
	  			<button @click="add" :disabled="!name||!pwd" class='btn'>登錄</button>
	  		</div>
	  		<div id='bottomDiv'>
	  			<a @click="goRegister">我要注冊</a>
	  		</div>
  		</div>
  		<div v-show='page==="register"'>
  			<div>
	  			<h1 class='title'>注冊界面,沒寫,哈哈</h1>
  			</div>
  			<div id='bottomDiv'>
	  			<a @click="goLogin">我要登錄</a>
	  		</div>
  		</div>
  		<div v-show='page==="suc"'>
  			<div>
	  			<h1 class='title'>登錄成功</h1>
  			</div>
  			<div id='bottomDiv'>
	  			<a @click="exit">退出登錄</a>
	  		</div>
  		</div>
		</div> 
  </body>
  <script src="vue.js"></script>
 	<script>
     new Vue({
      el:'#app',
      data:{
      	page:'advert',//默認(rèn)是倒計(jì)時(shí)的顯示廣告 login/register 分別表示登錄、注冊
      	n:5,
      	intervalId:'',
      	name:'',
      	pwd:''
      },
      methods:{
      	autoPlay:function(){
      		//自動進(jìn)行到計(jì)時(shí)
      		this.intervalId=setInterval(()=>{
      			if(this.n===0){//當(dāng)?shù)褂?jì)時(shí)為0的時(shí)候,跳轉(zhuǎn)登錄界面,并清除定時(shí)器
	      			this.page='login';//設(shè)置page為login
	      			clearInterval(this.intervalId);
	      			return ;
	      		}
	      		this.n--;
      		},1000);
      	},
      	goLogin:function(){//點(diǎn)擊到登錄界面
      		this.page='login';//設(shè)置page為login
      		clearInterval(this.intervalId);
      	},
      	add:function(){
      		//控制跳轉(zhuǎn)到成功
      		this.page='suc';
      	},
      	goRegister:function(){
      		//控制跳轉(zhuǎn)到注冊
      		this.page='register';
      		this.name=this.pwd='';
      	},
      	exit:function(){
      		//控制跳轉(zhuǎn)到登錄
      		this.page='login';
      		this.name=this.pwd='';
      	}	
      },
      computed:{
      	
      },
      mounted:function(){
      	//生命周期 mounted就執(zhí)行 倒計(jì)時(shí)函數(shù)
      	this.autoPlay();
      }
    })
 	</script>	
		
</html>

到此這篇關(guān)于vue實(shí)現(xiàn)登錄、注冊、退出、跳轉(zhuǎn)等功能的文章就介紹到這了,更多相關(guān)vue實(shí)現(xiàn)登錄、注冊、退出、跳轉(zhuǎn)內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • vue解決使用webpack打包后keep-alive不生效的方法

    vue解決使用webpack打包后keep-alive不生效的方法

    今天小編就為大家分享一篇vue解決使用webpack打包后keep-alive不生效的方法,具有很好的參考價(jià)值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2018-09-09
  • 使用Vue3實(shí)現(xiàn)一個(gè)穿梭框效果的示例代碼

    使用Vue3實(shí)現(xiàn)一個(gè)穿梭框效果的示例代碼

    這篇文章主要給大家介紹了如何使用?Vue3?實(shí)現(xiàn)一個(gè)穿梭框效果,當(dāng)選中數(shù)據(jù),并且點(diǎn)擊相對應(yīng)的方向箭頭時(shí),選中的數(shù)據(jù)會發(fā)送到對面,并且數(shù)據(jù)會保持正確的順序進(jìn)行排列,文中有詳細(xì)的代碼講解,具有一定的參考價(jià)值,需要的朋友可以參考下
    2023-12-12
  • Vue完整版和runtime版的區(qū)別詳解

    Vue完整版和runtime版的區(qū)別詳解

    這篇文章主要為大家介紹了Vue完整版和runtime版的區(qū)別詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2022-12-12
  • vue中this.$refs有值,但無法獲取ref的值問題及解決

    vue中this.$refs有值,但無法獲取ref的值問題及解決

    這篇文章主要介紹了vue中this.$refs有值,但無法獲取ref的值問題及解決方案,具有很好的參考價(jià)值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2023-01-01
  • Vue Treeselect樹形下拉框的使用小結(jié)

    Vue Treeselect樹形下拉框的使用小結(jié)

    樹形下拉框是一個(gè)帶有下列樹形結(jié)構(gòu)的下拉框,本文主要介紹了Vue Treeselect樹形下拉框的使用小結(jié),具有一定的參考價(jià)值,感興趣的可以了解一下
    2023-10-10
  • vue--vuex詳解

    vue--vuex詳解

    這篇文章主要介紹了vue--vuex的詳解,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2019-04-04
  • 基于Electron24+Vite4+Vue3搭建桌面端應(yīng)用實(shí)戰(zhàn)教程

    基于Electron24+Vite4+Vue3搭建桌面端應(yīng)用實(shí)戰(zhàn)教程

    這篇文章主要介紹了基于Electron24+Vite4+Vue3搭建桌面端應(yīng)用,這次給大家主要分享的是基于electron最新版本整合vite4.x構(gòu)建vue3桌面端應(yīng)用程序,需要的朋友可以參考下
    2023-05-05
  • vue實(shí)現(xiàn)點(diǎn)擊展開點(diǎn)擊收起效果

    vue實(shí)現(xiàn)點(diǎn)擊展開點(diǎn)擊收起效果

    這篇文章主要介紹了vue實(shí)現(xiàn)點(diǎn)擊展開,點(diǎn)擊收起效果,首先我們需要定義data里面的數(shù)據(jù),使用computed對data進(jìn)行處理,需要的朋友可以參考下
    2018-04-04
  • Vant picker選擇器設(shè)置默認(rèn)值導(dǎo)致選擇器失效的解決

    Vant picker選擇器設(shè)置默認(rèn)值導(dǎo)致選擇器失效的解決

    這篇文章主要介紹了Vant picker選擇器設(shè)置默認(rèn)值導(dǎo)致選擇器失效的解決方案,具有很好的參考價(jià)值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2023-01-01
  • 使用vue?v-for循環(huán)圖片路徑方式

    使用vue?v-for循環(huán)圖片路徑方式

    這篇文章主要介紹了使用vue?v-for循環(huán)圖片路徑方式,具有很好的參考價(jià)值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2022-04-04

最新評論

调兵山市| 南岸区| 广宁县| 吉安市| 嘉禾县| 商都县| 邢台县| 衢州市| 多伦县| 横山县| 靖安县| 永顺县| 沾益县| 张家界市| 渝中区| 荥经县| 宜城市| 北碚区| 电白县| 福州市| 页游| 六盘水市| 正宁县| 巫溪县| 东光县| 梧州市| 望奎县| 合水县| 黎川县| 博爱县| 巴彦淖尔市| 澜沧| 长垣县| 赤城县| 临汾市| 东城区| 闸北区| 宜丰县| 连江县| 宣城市| 湖口县|