fix(components)!: rename select to onSelect on items

This commit is contained in:
Benjamin Canac
2024-10-15 13:10:58 +02:00
parent 6af276ef38
commit b39c4d127e
21 changed files with 76 additions and 125 deletions

View File

@@ -24,13 +24,13 @@ const items = [
[{
label: 'Show Sidebar',
kbds: ['meta', 'S'],
select() {
onSelect() {
console.log('Show Sidebar clicked')
}
}, {
label: 'Show Toolbar',
kbds: ['shift', 'meta', 'D'],
select() {
onSelect() {
console.log('Show Toolbar clicked')
}
}, {
@@ -49,25 +49,25 @@ const items = [
children: [[{
label: 'View Source',
kbds: ['option', 'meta', 'U'],
select() {
onSelect() {
console.log('View Source clicked')
}
}, {
label: 'Developer Tools',
kbds: ['option', 'meta', 'I'],
select() {
onSelect() {
console.log('Developer Tools clicked')
}
}], [{
label: 'Inspect Elements',
kbds: ['option', 'meta', 'C'],
select() {
onSelect() {
console.log('Inspect Elements clicked')
}
}], [{
label: 'JavaScript Console',
kbds: ['option', 'meta', 'J'],
select() {
onSelect() {
console.log('JavaScript Console clicked')
}
}]]

View File

@@ -13,7 +13,7 @@ const items = [
label: 'Profile',
icon: 'i-heroicons-user',
slot: 'custom' as const,
select(e: Event) {
onSelect(e: Event) {
e.preventDefault()
console.log('Profile clicked')
}
@@ -21,14 +21,14 @@ const items = [
label: 'Billing',
icon: 'i-heroicons-credit-card',
kbds: ['meta', 'b'],
select() {
onSelect() {
console.log('Billing clicked')
}
}, {
label: 'Settings',
icon: 'i-heroicons-cog',
kbds: ['?'],
select() {
onSelect() {
console.log('Settings clicked')
}
}], [{
@@ -44,7 +44,7 @@ const items = [
label: 'Invite by link',
icon: 'i-heroicons-link',
kbds: ['meta', 'i'],
select(e: Event) {
onSelect(e: Event) {
e?.preventDefault()
console.log('Invite by link clicked')
}
@@ -56,21 +56,21 @@ const items = [
icon: 'i-simple-icons-slack',
to: 'https://slack.com',
target: '_blank',
select(e: Event) {
onSelect(e: Event) {
e.preventDefault()
console.log('Import from Slack clicked')
}
}, {
label: 'Import from Trello',
icon: 'i-simple-icons-trello',
select(e: Event) {
onSelect(e: Event) {
e.preventDefault()
console.log('Import from Trello clicked')
}
}, {
label: 'Import from Asana',
icon: 'i-simple-icons-asana',
select(e: Event) {
onSelect(e: Event) {
e.preventDefault()
console.log('Import from Asana clicked')
}
@@ -80,7 +80,7 @@ const items = [
label: 'New team',
icon: 'i-heroicons-plus',
kbds: ['meta', 'n'],
select() {
onSelect() {
console.log('New team clicked')
}
}], [{
@@ -88,7 +88,7 @@ const items = [
icon: 'i-simple-icons-github',
to: 'https://github.com/nuxt/ui',
target: '_blank',
select(e: Event) {
onSelect(e: Event) {
e.preventDefault()
}
}, {
@@ -108,7 +108,7 @@ const items = [
label: 'Logout',
icon: 'i-heroicons-arrow-right-start-on-rectangle',
kbds: ['shift', 'meta', 'q'],
select() {
onSelect() {
console.log('Logout clicked')
}
}]