From cf5d5ffc8350d86daaca952c24452b16e368c127 Mon Sep 17 00:00:00 2001 From: hcong <1050828145@qq.com> Date: 星期五, 11 十月 2024 10:14:20 +0800 Subject: [PATCH] 问题审核 --- src/components/ToolBar.vue | 41 +++++++++++++++++++++++++---------------- 1 files changed, 25 insertions(+), 16 deletions(-) diff --git a/src/components/ToolBar.vue b/src/components/ToolBar.vue index bf2912b..09c3f3b 100644 --- a/src/components/ToolBar.vue +++ b/src/components/ToolBar.vue @@ -1,17 +1,25 @@ <template> - <div class="layout" > + <div class="layout"> <el-row v-if="title"> - <el-col :span=" 16 " class="title">{{ title }}</el-col> - <el-col :span=" 8 "> + <el-col :span="16" class="title">{{ title }}</el-col> + <el-col :span="8"> <el-row justify="end" class="btn-group"> - <el-button v-for="(b, i) in buttons" :key=" i " :type=" b.color ? b.color : 'primary' " size="small">{{ b.name - }}</el-button> + <el-button + v-for="(b, i) in buttons" + :key="i" + :type="b.color ? b.color : 'primary'" + size="small" + @click="b.click" + >{{ b.name }}</el-button + > </el-row> </el-col> </el-row> <el-row class="tag-group" v-if="title"> <el-space> - <el-tag v-for="(d, i) in descriptions" :key=" i " type="info" size="small">{{ d.name + ": " + d.value }}</el-tag> + <el-tag v-for="(d, i) in descriptions" :key="i" type="info" size="small">{{ + d.name + ': ' + d.value + }}</el-tag> </el-space> </el-row> </div> @@ -27,21 +35,22 @@ type: Array, default: () => [ { - name: "", - value: "", - }, - ], + name: '', + value: '' + } + ] }, buttons: { type: Array, default: () => [ { - name: "", - color: "primary", - }, - ], - }, - }, + name: '', + color: 'primary', + click: () => {} + } + ] + } + } }; </script> <style scoped> -- Gitblit v1.9.3