[新增] radio 单选组件
This commit is contained in:
parent
d3fd62254b
commit
bca3f1b061
@ -168,3 +168,31 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
::: demo
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<lay-form>
|
||||||
|
<lay-radio v-model="selected" name="action" label="1">写作</lay-radio>
|
||||||
|
<lay-radio v-model="selected" name="action" label="2">画画</lay-radio>
|
||||||
|
<lay-radio v-model="selected" name="action" label="3">运动</lay-radio>
|
||||||
|
</lay-form>
|
||||||
|
{{selected}}
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { ref } from 'vue'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
setup() {
|
||||||
|
|
||||||
|
const selected = ref("1");
|
||||||
|
|
||||||
|
return {
|
||||||
|
selected
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
:::
|
@ -43,6 +43,6 @@ const handleClick = function () {
|
|||||||
if (props.disabled) {
|
if (props.disabled) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
emit('update:modelValue', !props.modelValue)
|
emit('update:modelValue', props.label)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
Loading…
x
Reference in New Issue
Block a user