@community-release/nx-ui 0.0.20 → 0.0.22
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.
package/dist/module.json
CHANGED
|
@@ -33,17 +33,17 @@
|
|
|
33
33
|
default: () => []
|
|
34
34
|
},
|
|
35
35
|
/**
|
|
36
|
-
* Slide that is
|
|
37
|
-
* @values 1, 2, 3, 1000
|
|
36
|
+
* Slide that is open by default, -1 = all closed
|
|
37
|
+
* @values -1, 1, 2, 3, 1000
|
|
38
38
|
*/
|
|
39
|
-
|
|
40
|
-
type:
|
|
41
|
-
default:
|
|
42
|
-
}
|
|
39
|
+
open: {
|
|
40
|
+
type: Number,
|
|
41
|
+
default: -1
|
|
42
|
+
},
|
|
43
43
|
});
|
|
44
44
|
|
|
45
|
-
const
|
|
46
|
-
const
|
|
45
|
+
const open = ref(props.open);
|
|
46
|
+
const counter = ref(0);
|
|
47
47
|
|
|
48
48
|
const iconLightComputed = computed(() => {
|
|
49
49
|
return props.icon !== '' ? `url(${props.icon})` : 'none';
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
});
|
|
55
55
|
|
|
56
56
|
provide('accordionData', {
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
counter,
|
|
58
|
+
open,
|
|
59
59
|
haveIcon: !!props.icon
|
|
60
60
|
});
|
|
61
61
|
</script>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<section class="component-ui-accordion-item"
|
|
3
|
-
:class="{'tag-active': accordionData.
|
|
3
|
+
:class="{'tag-active': accordionData.open.value === id, 'tag-icon': accordionData.haveIcon}"
|
|
4
4
|
>
|
|
5
|
-
<div class="header" @click="accordionData.
|
|
5
|
+
<div class="header" @click="accordionData.open.value = accordionData.open.value === id ? -1 : id">
|
|
6
6
|
<i class="icon"></i>
|
|
7
7
|
<div class="title">{{ title }}</div>
|
|
8
8
|
<div class="btn-toggle"></div>
|
|
@@ -14,16 +14,16 @@
|
|
|
14
14
|
</template>
|
|
15
15
|
|
|
16
16
|
<script setup>
|
|
17
|
-
|
|
17
|
+
// Import
|
|
18
18
|
import { inject } from 'vue'
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
const accordionData = inject('accordionData'
|
|
20
|
+
// Data
|
|
21
|
+
const accordionData = inject('accordionData');
|
|
22
22
|
const props = defineProps({
|
|
23
23
|
title: String,
|
|
24
24
|
text: String,
|
|
25
25
|
});
|
|
26
|
-
const id = accordionData.
|
|
26
|
+
const id = accordionData.counter.value++;
|
|
27
27
|
</script>
|
|
28
28
|
|
|
29
29
|
<style lang="less">
|
|
@@ -162,12 +162,6 @@
|
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
&.tag-icon {
|
|
165
|
-
// .header {
|
|
166
|
-
// position: relative;
|
|
167
|
-
// padding: @com-space-small var(--ui-accordion-btn-padding) @com-space-small calc(var(--ui-accordion-icon-size) + @com-space-default);
|
|
168
|
-
// margin-bottom: @com-space-mini;
|
|
169
|
-
// cursor: pointer;
|
|
170
|
-
// }
|
|
171
165
|
--ui-accordion-icon-size: @com-icon-size;
|
|
172
166
|
}
|
|
173
167
|
}
|
|
@@ -177,7 +171,6 @@
|
|
|
177
171
|
&.tag-icon {
|
|
178
172
|
--ui-accordion-icon-size: @com-icon-size-small;
|
|
179
173
|
}
|
|
180
|
-
//--ui-accordion-icon-size: @com-icon-size-small;
|
|
181
174
|
--ui-accordion-btn-padding: @com-btn-padding-small;
|
|
182
175
|
|
|
183
176
|
font-size: @com-text-default;
|