Closed taozuhong closed 5 months ago
排序功能已增加,需更新版本至2.0.2
。增加了sort
属性,该属性的值需为一个函数,与Array.sort
功能一致
支持权重值吗? 我在想排序如何实现置顶的意图呢
2.0.3
已支持该功能。你需要传递一个transform
属性,你可以通过该函数对数据列表进行深度定制,如排序、过滤、置顶等;该属性值的类型需为function
,且该函数必须返回处理过后的列表。
求分享 transform 的使用案例,谢谢。
还有我注意到项目没有明确的许可证,可能让大家不敢使用哦。
求分享 transform 的使用案例,谢谢。
<template>
<Vue3CountryIntl :transform="transform"></Vue3CountryIntl>
</template>
<script setup>
const transform = function (countryList) {
let newCountryList = ... // 你的排序排序逻辑
return newCountryList
}
</script>
还有我注意到项目没有明确的许可证,可能让大家不敢使用哦。
无需担心,本套代码使用MIT协议,后续我会把开源协议写进去
能否支持置顶某些国家,比如把中国、美国、日本等国家靠前显示。
感谢楼主的分享和支持。