@vue-ui-kit/ant 2.0.8 → 2.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,39 +1,35 @@
1
1
  <script setup lang="ts">
2
- import { ref } from 'vue'
2
+ import { ref } from 'vue';
3
3
 
4
- interface Props {
5
- /** 是否默认折叠 */
6
- defaultCollapsed?: boolean
7
- title?: string
8
- /** 是否可以折叠 */
9
- collapsible?: boolean
10
- }
4
+ interface Props {
5
+ /** 是否默认折叠 */
6
+ defaultCollapsed?: boolean;
7
+ title?: string;
8
+ /** 是否可以折叠 */
9
+ collapsible?: boolean;
10
+ }
11
11
 
12
- const props = withDefaults(defineProps<Props>(), {
13
- title: undefined,
14
- defaultCollapsed: false,
15
- collapsible: false,
16
- })
17
- const slots = defineSlots<{
18
- title: () => any
19
- }>()
20
- const activeKey = ref(props.defaultCollapsed ? [] : ['content'])
21
- defineExpose({
22
- collapse: () => {
23
- activeKey.value = []
24
- },
25
- expand: () => {
26
- activeKey.value = ['content']
27
- },
28
- })
12
+ const props = withDefaults(defineProps<Props>(), {
13
+ title: undefined,
14
+ defaultCollapsed: false,
15
+ collapsible: false,
16
+ });
17
+ const slots = defineSlots<{
18
+ title: () => any;
19
+ }>();
20
+ const activeKey = ref(props.defaultCollapsed ? [] : ['content']);
21
+ defineExpose({
22
+ collapse: () => {
23
+ activeKey.value = [];
24
+ },
25
+ expand: () => {
26
+ activeKey.value = ['content'];
27
+ },
28
+ });
29
29
  </script>
30
30
 
31
31
  <template>
32
- <a-collapse
33
- v-if="collapsible"
34
- v-model:active-key="activeKey"
35
- class="collapsible-card"
36
- >
32
+ <a-collapse v-if="collapsible" v-model:active-key="activeKey" class="collapsible-card">
37
33
  <a-collapse-panel key="content" force-render :header="title">
38
34
  <template v-if="slots.title" #header>
39
35
  <slot name="title" />
@@ -47,28 +43,4 @@ defineExpose({
47
43
  </template>
48
44
  <slot />
49
45
  </a-card>
50
- </template>
51
-
52
- <style scoped lang="scss">
53
- //样式改成card样式
54
- .collapsible-card {
55
- background-color: #fff;
56
- border-color: #f0f0f0;
57
- :deep(.ant-collapse-header) {
58
- padding: 0 12px;
59
- min-height: 38px;
60
- display: flex;
61
- align-items: center;
62
- font-weight: 600;
63
- }
64
- :deep(.ant-collapse-content) {
65
- border-color: #f0f0f0;
66
- .ant-collapse-content-box {
67
- padding: var(--collapsible-card-body-padding, 12px);
68
- }
69
- }
70
- :deep(.ant-collapse-item) {
71
- border-color: #f0f0f0;
72
- }
73
- }
74
- </style>
46
+ </template>
@@ -19,7 +19,7 @@
19
19
  import { valued } from '@/utils/is';
20
20
  import { MenuInfo } from 'ant-design-vue/es/menu/src/interface';
21
21
  import { $warning } from '@/hooks/useMessage';
22
- import CollapseCard from './CollapseCard.vue';
22
+ import CollapseCard from './CollapseCard.vue';
23
23
 
24
24
  const useForm = Form.useForm;
25
25
  const tabsRef = ref<InstanceType<typeof Tabs>>();
@@ -234,7 +234,13 @@ import CollapseCard from './CollapseCard.vue';
234
234
  });
235
235
  </script>
236
236
  <template>
237
- <collapse-card ref="rootRef" :title="title" size="small" :collapsible="collapsible" :default-collapsed="defaultCollapsed">
237
+ <collapse-card
238
+ ref="rootRef"
239
+ :title="title"
240
+ size="small"
241
+ :collapsible="collapsible"
242
+ :default-collapsed="defaultCollapsed"
243
+ >
238
244
  <a-spin v-if="loading" class="w-full" />
239
245
  <a-tabs
240
246
  v-else
@@ -304,6 +304,27 @@
304
304
  justify-content: flex-start;
305
305
  }
306
306
  }
307
+
308
+ .collapsible-card {
309
+ background-color: #fff;
310
+ border-color: #f0f0f0;
311
+ .ant-collapse-header {
312
+ padding: 0 12px;
313
+ min-height: 38px;
314
+ display: flex;
315
+ align-items: center;
316
+ font-weight: 600;
317
+ }
318
+ .ant-collapse-content {
319
+ border-color: #f0f0f0;
320
+ .ant-collapse-content-box {
321
+ padding: var(--collapsible-card-body-padding, 12px);
322
+ }
323
+ }
324
+ .ant-collapse-item {
325
+ border-color: #f0f0f0;
326
+ }
327
+ }
307
328
  /* #endregion */
308
329
 
309
330
  /* #region EVirtTable */
@@ -1,3 +1,4 @@
1
1
  :root {
2
2
  --p-theme-bg: #fff;
3
+ --collapsible-card-body-padding: 12px;
3
4
  }