@varlet/ui
Version:
A Vue3 component library based on Material Design 2 and 3, supporting mobile and desktop.
17 lines (16 loc) • 380 B
JavaScript
import { useChildren } from "@varlet/use";
const RADIO_GROUP_BIND_RADIO_KEY = Symbol("RADIO_GROUP_BIND_RADIO_KEY");
function useRadios() {
const { bindChildren, childProviders, length } = useChildren(
RADIO_GROUP_BIND_RADIO_KEY
);
return {
length,
radios: childProviders,
bindRadios: bindChildren
};
}
export {
RADIO_GROUP_BIND_RADIO_KEY,
useRadios
};