diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts
index f6777ba..e744864 100644
--- a/docs/.vitepress/config.ts
+++ b/docs/.vitepress/config.ts
@@ -45,6 +45,7 @@ function getComponents() {
{ text: 'Carousel', link: 'components/carousel/carousel.md' },
{ text: 'Dropdown', link: '/components/dropdown/dropdown.md' },
{ text: 'Progress', link: 'components/progress/progress.md' },
+ { text: 'Rating', link: 'components/rating/rating.md' },
{ text: 'Spinner', link: '/components/spinner/spinner.md' },
{ text: 'Tabs', link: '/components/tabs/tabs.md' },
{ text: 'ListGroup', link: 'components/listGroup/listGroup.md' },
@@ -55,7 +56,6 @@ function getComponents() {
{ text: '- Footer', link: 'components/footer/footer.md' },
{ text: '- Pagination', link: 'components/pagination/pagination.md' },
- { text: '- Rating', link: 'components/rating/rating.md' },
{ text: '- Sidebar', link: 'components/sidebar/sidebar.md' },
{ text: '- Table', link: 'components/table/table.md' },
{ text: '- Timeline', link: 'components/timeline/timeline.md' },
diff --git a/docs/components/rating/examples/RatingCountExample.vue b/docs/components/rating/examples/RatingCountExample.vue
index 91d051e..08cc1b9 100644
--- a/docs/components/rating/examples/RatingCountExample.vue
+++ b/docs/components/rating/examples/RatingCountExample.vue
@@ -1,15 +1,14 @@
diff --git a/docs/components/rating/examples/RatingExample.vue b/docs/components/rating/examples/RatingExample.vue
index 7eab3d4..cb1626d 100644
--- a/docs/components/rating/examples/RatingExample.vue
+++ b/docs/components/rating/examples/RatingExample.vue
@@ -1,6 +1,6 @@
-
+
-
+
```
@@ -26,7 +26,7 @@ If you also want to show a text near the stars you can use this example as a ref
import { Rating } from 'flowbite-vue'
-
+
4.95 out of 5
@@ -43,16 +43,15 @@ Aggregate more results by using this example to show the amount of reviews and t
import { Rating } from 'flowbite-vue'
-
4.95
-
```
@@ -67,11 +66,11 @@ import { Rating } from 'flowbite-vue'
-
+
-
+
-
+
```
diff --git a/src/components/Rating/Rating.vue b/src/components/Rating/Rating.vue
index c702f33..c6ece2f 100644
--- a/src/components/Rating/Rating.vue
+++ b/src/components/Rating/Rating.vue
@@ -1,30 +1,41 @@
@@ -36,7 +47,7 @@ import type { RatingSize } from './types'
const props = defineProps({
size: {
- type: String as PropType, // 'sm' | 'md' | 'lg'
+ type: String as PropType,
default: 'sm',
},
rating: {
@@ -49,12 +60,12 @@ const props = defineProps({
},
reviewText: {
type: String,
- default: ""
+ default: '',
},
reviewLink: {
type: String,
- default: ""
- }
+ default: '',
+ },
})
const valid_star_number = computed(() => {
diff --git a/src/components/Rating/composables/useRatingClasses.ts b/src/components/Rating/composables/useRatingClasses.ts
index c90bd28..c25c8f4 100644
--- a/src/components/Rating/composables/useRatingClasses.ts
+++ b/src/components/Rating/composables/useRatingClasses.ts
@@ -6,7 +6,7 @@ import type { RatingSize } from '../types'
const ratingSizeClasses: Record = {
sm: 'w-5 h-5',
md: 'w-7 h-7',
- lg: 'w-10 h-10'
+ lg: 'w-10 h-10',
}
export type UseRatingClassesProps = {
@@ -17,15 +17,12 @@ export function useRatingClasses(props: UseRatingClassesProps):{
sizeClasses: Ref
}{
const sizeClasses = computed(() => {
- let sizeClass = ''
- sizeClass = ratingSizeClasses[props.size.value]
return classNames(
- sizeClass
+ ratingSizeClasses[props.size.value] ?? '',
)
})
-
return {
- sizeClasses
+ sizeClasses,
}
-}
\ No newline at end of file
+}