Skip to content

useCollator

@astryxdesign/core v0.7.1 · useCollator

参数 ​

名称类型默认值说明
optionsMaybeRefOrGetter<Intl.CollatorOptions | undefined>—可选的比较规则,例如数字顺序、大小写敏感度、标点处理和大小写先后。选项会变的时候传 ref 或取值函数,变了比较器会重建。

返回值 ​

名称类型说明
collatorComputedRef<Intl.Collator>绑定到当前 InternationalizationProvider 语言的比较器,带缓存。比较时读 collator.value。