operateList.vue 1.5 KB
<template>
	<view class="operate">
		<view class="operate_list">
			<view class="operate_item">
				<text class="operate_btn" :class="{active: current === 0 }" @click="handleReturn">退回</text>
			</view>
			<view class="operate_item">
				<text class="operate_btn" :class="{active: current === 1 }" @click="handleInvalid">作废</text>
			</view>
			<view class="operate_item">
				<text class="operate_btn" :class="{active: current === 2 }" @click="handleUpdate">修改</text>
			</view>
			<view class="operate_item">
				<text class="operate_btn" :class="{active: current === 3 }" @click="handleCirculation">流转</text>
			</view>
		</view>
	</view>
</template>

<script setup>
import { ref } from 'vue'
const current = ref(9)
const handleReturn = () => {
		current.value = 0
	}
	const handleInvalid = () => {
		current.value = 1
	}
	const handleUpdate = () => {
		current.value = 2
	}
	const handleCirculation = () => {
		current.value = 3
	}
</script>

<style lang="scss" scoped>
.operate{
	.operate_list{
		display: flex;
		align-items: center;
		.operate_item{
			display: flex;
			align-items: center;
			justify-content: center;
			flex: 1;
			height: 40rpx;
			border-right: 2rpx solid #3680FE;
			&:last-child{
				border-right: 0;
			}
			.operate_btn{
				width: 100rpx;
				height: 40rpx;
				line-height: 40rpx;
				font-size: 24rpx;
				text-align: center;
				border-radius: 8rpx;
				&.active{
					background: #3680FE;
					color: #fff;
				}
			}
		}
	}
}
</style>