Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const handleSortArray = (a: RegionType, b: RegionType) => (a.value < b.value ? 1 : b.value < a.value ? -1 : 0)
- const handleSortArrayTwo = (a: RegionType, b: RegionType) =>
- props.required?.campaignInfo?.chooseRegions.includes(a.key) ? 1 : !props.required?.campaignInfo?.chooseRegions.includes(a.key) ? 0 : -1
- watch(
- () => props.required?.campaignInfo,
- () => {
- totalCountRegions.value = getTotalCount(props.required?.campaignInfo?.regionsCount || { '1': 0 })
- regions.value = getRegions(props.required?.campaignInfo?.regionsCount || { '1': 0 })
- .sort(handleSortArray)
- .sort(handleSortArrayTwo)
- console.log(regions.value)
- }
- )
Add Comment
Please, Sign In to add comment