TDesign 步骤条用法

html 复制代码
<template>
    <div>
        <t-steps layout="vertical" :current="options.third" theme="dot" @change="onThirdChange">
            <t-step-item
                v-for="(step, index) in steps"
                :key="index"
                :title="getTitle('third', index)"
            >
                <template #content>
                    <div>{{ step.content }}</div>
                </template>
            </t-step-item>
        </t-steps>
    </div>
</template>

<script setup>
import { ref} from "vue";

const options = ref({
    third: 2, // 当前步骤索引
});

// 自定义步骤数据
const steps = ref([
    { title: "步骤 1", content: "提交" },
    { title: "步骤 2", content: "团委审核" },
    { title: "步骤 3", content: "院级审核" },
    { title: "步骤 4", content: "校级审核" },
  { title: "步骤 5", content: "通过" },
]);

// 根据当前步骤索引计算步骤标题
function getTitle(type, index) {
    if (index === options.value.third) {
        return "当前步骤";
    }
    if (index < options.value.third) {
        return "已完成";
    }
    return "未完成步骤";
}

// 更新当前步骤索引
function onThirdChange(index) {
    options.value.third = index;
}
</script>

<style>
/* 在这里添加其他样式(如果需要) */
</style>
相关推荐
qq 180809515 天前
D*算法路径规划 Matlab路径规划 栅格法 可自行更改绘制栅格地图,自定义起始点目标点位置...
tdesign
ttod_qzstudio9 天前
DriveLerpControllerEditor开发总结:一个3D编辑器插值控制系统的实现
vue.js·typescript·编辑器·tdesign
ttod_qzstudio11 天前
事件冒泡踩坑记:一个TDesign Checkbox引发的思考
前端·javascript·vue.js·tdesign
询问QQ:6882388621 天前
基于MATLAB的三维SD-MTSP:采用蛇优化算法SO求解多旅行商问题的三维单仓库数据处理及...
tdesign
ttod_qzstudio2 个月前
替代 TDesign Dialog:用 div 实现可拖拽、遮罩屏蔽的对话框
前端·tdesign
是大刚啊2 个月前
微信小程序原生车牌输入器
微信小程序·小程序·tdesign·车牌号·车牌输入
小__小__码3 个月前
Python数据可视化用Matplotlib和Seaborn提升你的数据分析效率
tdesign
2401_853406884 个月前
Tdesign-React 组件 Card 实现头部固定,内容区单独可滚动
前端·react.js·tdesign
QC班长9 个月前
微信小程序引入TDesign组件后报错一直提示路径不对(Component is not found in path)的解决方法
微信小程序·小程序·tdesign·引入tdesign组件后报错
杨天天.1 年前
微信小程序原生,tdesign时间选择器,t-date-time-picker封装成组件,开始时间结束时间
微信小程序·小程序·tdesign