-
Notifications
You must be signed in to change notification settings - Fork 271
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dropdown): [dropdown] add right side expansion function for drop…
…down (#2608) * feat(dropdown): [dropdown] add right side expansion function for dropdown * feat(dropdown): [dropdown] add right side expansion
- Loading branch information
Showing
6 changed files
with
183 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
examples/sites/demos/pc/app/dropdown/placement-composition-api.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<template> | ||
<tiny-dropdown> | ||
<template #dropdown> | ||
<tiny-dropdown-menu placement="bottom-start"> | ||
<tiny-dropdown-item label="老友粉"></tiny-dropdown-item> | ||
<tiny-dropdown-item>黄金糕</tiny-dropdown-item> | ||
<tiny-dropdown-item>狮子头</tiny-dropdown-item> | ||
<tiny-dropdown-item>螺蛳粉</tiny-dropdown-item> | ||
<tiny-dropdown-item disabled>双皮奶</tiny-dropdown-item> | ||
<tiny-dropdown-item>蚵仔煎</tiny-dropdown-item> | ||
</tiny-dropdown-menu> | ||
</template> | ||
</tiny-dropdown> | ||
<br /> | ||
<br /> | ||
<tiny-dropdown> | ||
<template #dropdown> | ||
<tiny-dropdown-menu :options="options" placement="bottom-start"> </tiny-dropdown-menu> | ||
</template> | ||
</tiny-dropdown> | ||
</template> | ||
|
||
<script setup> | ||
import { reactive } from 'vue' | ||
import { iconStarDisable } from '@opentiny/vue-icon' | ||
import { TinyDropdown, TinyDropdownMenu, TinyDropdownItem } from '@opentiny/vue' | ||
const options = reactive([ | ||
{ | ||
label: '老友粉1', | ||
icon: iconStarDisable(), | ||
children: [ | ||
{ | ||
label: '老友粉2.1', | ||
children: [{ label: '狮子头3.1' }] | ||
}, | ||
{ label: '老友粉2.2' }, | ||
{ label: '老友粉2.3', disabled: true } | ||
] | ||
}, | ||
{ | ||
label: '狮子头', | ||
disabled: true | ||
}, | ||
{ | ||
label: '黄金糕', | ||
icon: iconStarDisable() | ||
} | ||
]) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<template> | ||
<tiny-dropdown> | ||
<template #dropdown> | ||
<tiny-dropdown-menu placement="bottom-start"> | ||
<tiny-dropdown-item label="老友粉"></tiny-dropdown-item> | ||
<tiny-dropdown-item>黄金糕</tiny-dropdown-item> | ||
<tiny-dropdown-item>狮子头</tiny-dropdown-item> | ||
<tiny-dropdown-item>螺蛳粉</tiny-dropdown-item> | ||
<tiny-dropdown-item disabled>双皮奶</tiny-dropdown-item> | ||
<tiny-dropdown-item>蚵仔煎</tiny-dropdown-item> | ||
</tiny-dropdown-menu> | ||
</template> | ||
</tiny-dropdown> | ||
<br /> | ||
<br /> | ||
<tiny-dropdown> | ||
<template #dropdown> | ||
<tiny-dropdown-menu :options="options" placement="bottom-start"> </tiny-dropdown-menu> | ||
</template> | ||
</tiny-dropdown> | ||
</template> | ||
|
||
<script> | ||
import { iconStarDisable } from '@opentiny/vue-icon' | ||
import { TinyDropdown, TinyDropdownMenu, TinyDropdownItem } from '@opentiny/vue' | ||
export default { | ||
components: { | ||
TinyDropdown, | ||
TinyDropdownMenu, | ||
TinyDropdownItem | ||
}, | ||
data() { | ||
return { | ||
options: [ | ||
{ | ||
label: '老友粉1', | ||
icon: iconStarDisable(), | ||
children: [ | ||
{ | ||
label: '老友粉2.1', | ||
children: [{ label: '狮子头3.1' }] | ||
}, | ||
{ label: '老友粉2.2' }, | ||
{ label: '老友粉2.3', disabled: true } | ||
] | ||
}, | ||
{ | ||
label: '狮子头', | ||
disabled: true | ||
}, | ||
{ | ||
label: '黄金糕', | ||
icon: iconStarDisable() | ||
} | ||
] | ||
} | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters