From 2c5e4445f405ba7b7c61a2e12fc1ef60a62e9bf7 Mon Sep 17 00:00:00 2001
From: lyfO_o <764716047@qq.com>
Date: Wed, 20 Apr 2022 22:07:34 +0800
Subject: [PATCH] 考试系统(nanoweb) 认证跳转
---
src/views/exam/component/classification.vue | 65 ++++++++++++++++++++++++++++++++
1 files changed, 65 insertions(+), 0 deletions(-)
diff --git a/src/views/exam/component/classification.vue b/src/views/exam/component/classification.vue
new file mode 100644
index 0000000..ce8c06f
--- /dev/null
+++ b/src/views/exam/component/classification.vue
@@ -0,0 +1,65 @@
+<template>
+ <div >
+ <button
+ class="filter-btn"
+ v-for="(item,index) in array"
+ v-bind:class="{'active':index === num}"
+ :key="item.id"
+ @click="activeClick(item.id,index)">{{item.value}}</button>
+ </div>
+</template>
+
+<script>
+ export default {
+ name: "classification",
+ props: {
+ array: {
+ type: Array,
+ default: () => [],
+ required: true
+ },
+ },
+ data(){
+ return {
+ num:'',
+ isActive:false
+ }
+ },
+ methods:{
+ activeClick(id,index){
+ this.num = index
+ this.$emit("setId",id)
+ }
+ }
+
+ }
+
+</script>
+
+<style scoped>
+ .filter-btn{
+ cursor: pointer;
+ min-width: 112px;
+ height: 32px;
+ border-radius: 15px;
+ border: 1px solid #e5e5e5;
+ background-color: #fff;
+ color: #000;
+ font-size: 14px;
+ margin-right: 20px;
+ margin-bottom: 10px;
+ }
+
+ .filter-btn:hover{
+ border-color: #fff;
+ background-color: #b2d8ff;
+ color: #fff;
+ }
+
+ .active{
+ background-color: #5dadff;
+ border-color: #5dadff;
+ color: #fff;
+ }
+
+</style>
--
Gitblit v1.9.2