login.vue

<template>
 <div>
    <table>
		<tr>
			<td class="c1">学号:</td>
			<td class="c2"><input type="text" v-model="stuno"></td>
		</tr>
		<tr>
			<td class="c1">姓名:</td>
			<td class="c2"><input type="text" v-model="stuname"></td>
		</tr>
		<tr>
			<td class="c1">考试科目:</td>
			<td class="c2">
				<select v-model="examSubject">
					<option value="web应用前端开发">web应用前端开发</option>
				</select>
			</td>
		</tr>
		<tr>
			<td colspan="2"><button class="button" @click="start">开始考试</button></td>
		</tr>
	</table>
 </div>
</template>

<script>
 export default {
 data () {
 return {
    stuno:"",
    stuname:"",
    examSubject:""
  }
 },
 methods:{
    start(){
        if(this.stuno==""||this.stuname=="")
        alert("学号和姓名必须输入!");
        if(this.stuno.length!=12)
        alert("学号长度必须为12位!");
        if(this.examSubject != "web应用前端开发")
        alert("考试科目必须选择为“web应用前端开发”!");

        essionStorage.setItem("tokenno",this.stuno)
        essionStorage.setItem("tokenname",this.stuname)
        this.$router.push("/test")
    }
 }
}

</script>
<style scoped>
table {
    width: 300px;
    margin: 20px auto;
    border: 2px dashed #56CA95;
    padding: 10px;
}

table td {
    padding: 6px;
    text-align: center;
}
.c1{
    background-color: #D1ECDD;
}
.c2{
    background-color: #56CA95;
}

table tr:first-child td {
    background-color: #D1ECDD;
}

table tr:first-child td + td {
    background-color: #56CA95;
}

table tr:last-child td {
    text-align: center;
}

.button {
    background-color: #E9F6EF;
    border: none;
    color: #333;
    display: inline-block;
    font-size: 16px;
    margin-top: 10px;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.button:hover {
    background-color: #56CA95;
    color: #fff;
    cursor: pointer;
}
</style>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Adj_Seven

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值