@mc-markets/ui 1.1.64 → 1.1.65
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/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<el-date-picker ref="datePickerRef" v-bind="mergedAttrs" class="m-datepicker" :popper-class="
|
|
2
|
+
<el-date-picker ref="datePickerRef" v-bind="mergedAttrs" class="m-datepicker" :popper-class="computedPopperClass" :class="{ 'style-type-solid': styleType === 'solid' }">
|
|
3
3
|
<template v-for="(_, name) in $slots" :key="name" #[name]>
|
|
4
4
|
<slot :name="name" />
|
|
5
5
|
</template>
|
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
</template>
|
|
8
8
|
|
|
9
9
|
<script setup>
|
|
10
|
-
import {
|
|
10
|
+
import { computed, useAttrs } from 'vue'
|
|
11
11
|
import { useExposeRef } from '@packages/hooks/useExposeRef.js'
|
|
12
|
+
import { classNames, excludeAttrs } from '@packages/utils/classNames.js'
|
|
12
13
|
|
|
13
14
|
defineOptions({
|
|
14
15
|
name: "MDatePicker",
|
|
@@ -25,11 +26,19 @@ const props = defineProps({
|
|
|
25
26
|
},
|
|
26
27
|
});
|
|
27
28
|
|
|
28
|
-
//
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
)
|
|
29
|
+
// 获取 attrs
|
|
30
|
+
const attrs = useAttrs()
|
|
31
|
+
|
|
32
|
+
// 计算 popper-class,合并默认类名和外部传入的类名
|
|
33
|
+
const computedPopperClass = computed(() => {
|
|
34
|
+
const defaultPopperClass = 'mc-datepicker-popper'
|
|
35
|
+
const externalPopperClass = props.popperClass || attrs.popperClass || ''
|
|
36
|
+
|
|
37
|
+
return classNames(defaultPopperClass, externalPopperClass)
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
// 合并其他属性(排除 popperClass)
|
|
41
|
+
const mergedAttrs = computed(() => excludeAttrs(attrs, 'popperClass'))
|
|
33
42
|
|
|
34
43
|
const { innerRef: datePickerRef, exposedProxy } = useExposeRef('datePickerRef')
|
|
35
44
|
|