feat: add dropdown to multiselect
This commit is contained in:
1 parent
af1bdf194c
commit
dc1aba6c17
8 files changed
+107
-62
No files matched your search
@@ -0,0 +1,37 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/stores'
|
||||
import { searchParam } from '$lib/util.js'
|
||||
import MultiSelect from '../input/MultiSelect.svelte'
|
||||
|
||||
export let selected: string
|
||||
</script>
|
||||
|
||||
<MultiSelect
|
||||
options={[
|
||||
'Active',
|
||||
'Hot',
|
||||
'TopAll',
|
||||
'New',
|
||||
'Old',
|
||||
'TopMonth',
|
||||
'TopWeek',
|
||||
'TopDay',
|
||||
'MostComments',
|
||||
'NewComments',
|
||||
]}
|
||||
optionNames={[
|
||||
'Active',
|
||||
'Hot',
|
||||
'Top',
|
||||
'New',
|
||||
'Old',
|
||||
'Top Month',
|
||||
'Top Week',
|
||||
'Top Day',
|
||||
'Most Comments',
|
||||
'New Comments',
|
||||
]}
|
||||
{selected}
|
||||
on:select={(e) => searchParam($page.url, 'sort', e.detail, 'page')}
|
||||
class="w-full md:max-w-[20rem]"
|
||||
/>
|
||||
Reference in new issue
Block a user