mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-04-19 13:32:24 +00:00
chore: add custom descriptions component
This commit is contained in:
parent
b75a1ef5e1
commit
19ed426520
1 changed files with 59 additions and 0 deletions
59
web/html/component/aCustomDescriptions.html
Normal file
59
web/html/component/aCustomDescriptions.html
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
{{define "component/customDescriptions"}}
|
||||||
|
<template>
|
||||||
|
<a-descriptions class="ant-custom-descriptions" bordered :layout="layout" :size="size" :column="column">
|
||||||
|
<slot></slot>
|
||||||
|
</a-descriptions>
|
||||||
|
</template>
|
||||||
|
{{end}}
|
||||||
|
|
||||||
|
{{define "component/aCustomDescriptions"}}
|
||||||
|
<style>
|
||||||
|
.dark .ant-custom-descriptions {
|
||||||
|
.ant-descriptions-view,
|
||||||
|
.ant-descriptions-row,
|
||||||
|
.ant-descriptions-item-content,
|
||||||
|
.ant-descriptions-item-label {
|
||||||
|
border-color: var(--dark-color-surface-300);
|
||||||
|
border-right-color: var(--dark-color-surface-300);
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-descriptions-item-label {
|
||||||
|
background-color: var(--dark-color-surface-200);
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-descriptions-item-label,
|
||||||
|
.ant-descriptions-item-content {
|
||||||
|
color: var(--dark-color-text-primary);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
Vue.component('a-custom-descriptions', {
|
||||||
|
props: {
|
||||||
|
'layout': {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
defaultValue: "vertical",
|
||||||
|
validator: function (value) {
|
||||||
|
return ['horizontal', 'vertical'].includes(value)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'size': {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
defaultValue: "small",
|
||||||
|
validator: function (value) {
|
||||||
|
return ['small', 'middle'].includes(value)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'column': {
|
||||||
|
type: Number,
|
||||||
|
required: false,
|
||||||
|
defaultValue: 1,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
template: `{{template "component/customDescriptions"}}`,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
{{end}}
|
Loading…
Reference in a new issue