-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
36 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<template> | ||
<UITag | ||
:type="isActive ? 'primary' : 'boring'" | ||
@click="handleClick" | ||
> | ||
<slot></slot> | ||
</UITag> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { inject, computed } from 'vue' | ||
import UITag from '../UITag.vue' | ||
import { radioGroupValueKey, updateRadioValueKey } from './UITagRadioGroup.vue' | ||
const props = defineProps<{ | ||
value: string | ||
}>() | ||
const radioGroupValue = inject(radioGroupValueKey) | ||
const updateRadioValue = inject(updateRadioValueKey) | ||
const isActive = computed(() => radioGroupValue?.value === props.value) | ||
const handleClick = () => { | ||
updateRadioValue?.(props.value) | ||
} | ||
</script> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
export { default as UIRadio } from './UIRadio.vue' | ||
export { default as UIRadioGroup } from './UIRadioGroup.vue' | ||
// TODO: consider merging `UITagRadio` with `UIRadio` (with prop `style="tag"`) | ||
export { default as UITagRadio } from './UITagRadio.vue' | ||
export { default as UITagRadioGroup } from './UITagRadioGroup.vue' |