feat: tabs组件样式覆盖

This commit is contained in:
baiqi 2023-06-01 18:18:10 +08:00 committed by rubylliu
parent 8accf388ca
commit 9b1c1abb64
3 changed files with 146 additions and 79 deletions

View File

@ -0,0 +1,19 @@
/** 表格样式 **/
.arco-table-cell {
.circle {
display: inline-block;
margin-right: 4px;
width: 6px;
height: 6px;
border-radius: 50%;
background-color: rgb(var(--blue-6));
&.pass {
background-color: rgb(var(--green-6));
}
}
}
/** Tabs 组件样式 **/
.arco-tabs-nav-add-btn {
font-size: var(--font-size-base);
}

View File

@ -1,3 +1,5 @@
@import url('./arco-reset.less');
@tailwind base;
@tailwind components;
@tailwind utilities;
@ -74,16 +76,3 @@ body {
.split-line {
border-color: rgb(var(--gray-2));
}
.arco-table-cell {
.circle {
display: inline-block;
margin-right: 4px;
width: 6px;
height: 6px;
border-radius: 50%;
background-color: rgb(var(--blue-6));
&.pass {
background-color: rgb(var(--green-6));
}
}
}

View File

@ -1,5 +1,5 @@
<template>
<minder-editor
<!-- <minder-editor
class="minder-container"
:import-json="importJson"
:progress-enable="false"
@ -8,76 +8,135 @@
:default-mold="defaultMode"
:del-confirm="delConfirm"
@save="save"
/>
/> -->
<!-- <JsonPicker /> -->
<div class="bg-white">
<a-tabs>
<a-tab-pane key="1">
<template #title> <icon-calendar /> Tab 1 </template>
Content of Tab Panel 1
</a-tab-pane>
<a-tab-pane key="2">
<template #title> <icon-clock-circle /> Tab 2 </template>
Content of Tab Panel 2
</a-tab-pane>
<a-tab-pane key="3">
<template #title> <icon-user /> Tab 3 </template>
Content of Tab Panel 3
</a-tab-pane>
</a-tabs>
<a-tabs class="w-[500px]" :editable="true" show-add-button auto-switch @add="handleAdd" @delete="handleDelete">
<a-tab-pane v-for="(item, index) of data" :key="item.key" :title="item.title" :closable="index !== 2">
{{ item?.content }}
</a-tab-pane>
</a-tabs>
</div>
</template>
<script setup lang="ts">
import MinderEditor from '@/components/minder-editor/minderEditor.vue';
<script setup lang="ts" name="minderIndex">
import { ref } from 'vue';
let count = 5;
const data = ref([
{
key: '1',
title: 'Tab 1',
content: 'Content of Tab Panel 1',
},
{
key: '2',
title: 'Tab 2',
content: 'Content of Tab Panel 2',
},
{
key: '3',
title: 'Tab 3',
content: 'Content of Tab Panel 3',
},
{
key: '4',
title: 'Tab 4',
content: 'Content of Tab Panel 4',
},
]);
const handleAdd = () => {
const number = count++;
data.value = data.value.concat({
key: `${number}`,
title: `New Tab ${number}`,
content: `Content of New Tab Panel ${number}`,
});
};
const handleDelete = (key: string | number) => {
data.value = data.value.filter((item) => item.key !== key);
};
// import MinderEditor from '@/components/minder-editor/minderEditor.vue';
// import JsonPicker from '@/components/jsonpath-picker/index.vue';
const importJson = {
root: {
data: {
//
text: 'vue3-minder-editor',
//
resource: ['模块1'],
//
// disable: true,
// collapse
// const importJson = {
// root: {
// data: {
// //
// text: 'vue3-minder-editor',
// //
// resource: ['1'],
// //
// // disable: true,
// // collapse
// // expandState: 'collapse',
// // disable true
// // tagEnable: true,
// // disable true
// // allowDelete: true,
// // disable true tagEnable
// // allowDisabledTag: true,
// },
// //
// children: [
// {
// data: {
// text: 'child1',
// // disable: true,
// expandState: 'collapse',
// disable true
// tagEnable: true,
// disable true
// allowDelete: true,
// disable true tagEnable
// allowDisabledTag: true,
},
//
children: [
{
data: {
text: 'child1',
// resource: ['2'],
// },
// children: [
// {
// data: {
// text: 'axxaaaa',
// disable: true,
expandState: 'collapse',
resource: ['模块2'],
},
children: [
{
data: {
text: '地图axxaaaa',
disable: true,
allowDelete: true,
// tagEnable: true,
allowDisabledTag: true,
resource: ['模块12'],
priority: 3,
loaded: true,
},
},
],
},
{
data: {
text: 'child2',
},
},
],
},
template: 'default',
};
const height = 500;
const defaultMode = 3;
const tags = ['模块1', '用例', '前置条件', '测试步骤', '预期结果', '备注'];
// allowDelete: true,
// // tagEnable: true,
// allowDisabledTag: true,
// resource: ['12'],
// priority: 3,
// loaded: true,
// },
// },
// ],
// },
// {
// data: {
// text: 'child2',
// },
// },
// ],
// },
// template: 'default',
// };
// const height = 500;
// const defaultMode = 3;
// const tags = ['1', '', '', '', '', ''];
function save(data: any) {
// eslint-disable-next-line no-console
console.log(data);
}
// function save(data: any) {
// // eslint-disable-next-line no-console
// console.log(data);
// }
function delConfirm() {
// eslint-disable-next-line no-console
console.log('-=-=-=-=-=-=-==');
}
// function delConfirm() {
// // eslint-disable-next-line no-console
// console.log('-=-=-=-=-=-=-==');
// }
</script>