ny
昨天 282fbc6488f4e8ceb5fda759f963ee88fbf7b999
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<script lang="ts" setup>
import { computed, unref } from 'vue';
 
import { useAttrs } from '@jnpf/hooks';
 
import { Rate } from 'ant-design-vue';
 
defineOptions({ inheritAttrs: false, name: 'JnpfRate' });
 
const attrs = useAttrs({ excludeDefaultKeys: false });
 
const getBindValue: any = computed(() => ({ ...unref(attrs) }));
</script>
 
<template>
  <Rate v-bind="getBindValue">
    <template v-for="item in Object.keys($slots)" #[item]="data"><slot :name="item" v-bind="data || {}"></slot></template>
  </Rate>
</template>