mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-13 17:05:47 +08:00
fix(radio-group): restore name (#7810)
* fix(radio-group): restore name * fix(radio-group): restore name
This commit is contained in:
parent
ac83f03894
commit
d56520e4be
@ -12,7 +12,16 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { nextTick, onMounted, provide, reactive, ref, toRefs, watch } from 'vue'
|
||||
import {
|
||||
computed,
|
||||
nextTick,
|
||||
onMounted,
|
||||
provide,
|
||||
reactive,
|
||||
ref,
|
||||
toRefs,
|
||||
watch,
|
||||
} from 'vue'
|
||||
import { UPDATE_MODEL_EVENT } from '@element-plus/constants'
|
||||
import { radioGroupKey } from '@element-plus/tokens'
|
||||
import {
|
||||
@ -28,6 +37,7 @@ defineOptions({
|
||||
name: 'ElRadioGroup',
|
||||
})
|
||||
|
||||
let id = 1
|
||||
const props = defineProps(radioGroupProps)
|
||||
const emit = defineEmits(radioGroupEmits)
|
||||
|
||||
@ -52,11 +62,18 @@ onMounted(() => {
|
||||
}
|
||||
})
|
||||
|
||||
const randomName = `el-radio-group-${id++}`
|
||||
|
||||
const name = computed(() => {
|
||||
return props.name || randomName
|
||||
})
|
||||
|
||||
provide(
|
||||
radioGroupKey,
|
||||
reactive({
|
||||
...toRefs(props),
|
||||
changeEvent,
|
||||
name,
|
||||
})
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user