-
Notifications
You must be signed in to change notification settings - Fork 621
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4a99d6a
commit cce000a
Showing
24 changed files
with
1,087 additions
and
6 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
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,43 @@ | ||
<script setup> | ||
const people = [{ | ||
id: 1, | ||
name: 'Lindsay Walton', | ||
title: 'Front-end Developer', | ||
email: 'lindsay.walton@example.com', | ||
role: 'Member' | ||
}, { | ||
id: 2, | ||
name: 'Courtney Henry', | ||
title: 'Designer', | ||
email: 'courtney.henry@example.com', | ||
role: 'Admin' | ||
}, { | ||
id: 3, | ||
name: 'Tom Cook', | ||
title: 'Director of Product', | ||
email: 'tom.cook@example.com', | ||
role: 'Member' | ||
}, { | ||
id: 4, | ||
name: 'Whitney Francis', | ||
title: 'Copywriter', | ||
email: 'whitney.francis@example.com', | ||
role: 'Admin' | ||
}, { | ||
id: 5, | ||
name: 'Leonard Krasner', | ||
title: 'Senior Designer', | ||
email: 'leonard.krasner@example.com', | ||
role: 'Owner' | ||
}, { | ||
id: 6, | ||
name: 'Floyd Miles', | ||
title: 'Principal Designer', | ||
email: 'floyd.miles@example.com', | ||
role: 'Member' | ||
}] | ||
</script> | ||
|
||
<template> | ||
<UTable :rows="people" /> | ||
</template> |
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,59 @@ | ||
<script setup> | ||
const columns = [{ | ||
key: 'id', | ||
label: 'ID' | ||
}, { | ||
key: 'name', | ||
label: 'User name' | ||
}, { | ||
key: 'title', | ||
label: 'Job position' | ||
}, { | ||
key: 'email', | ||
label: 'Email' | ||
}, { | ||
key: 'role' | ||
}] | ||
const people = [{ | ||
id: 1, | ||
name: 'Lindsay Walton', | ||
title: 'Front-end Developer', | ||
email: 'lindsay.walton@example.com', | ||
role: 'Member' | ||
}, { | ||
id: 2, | ||
name: 'Courtney Henry', | ||
title: 'Designer', | ||
email: 'courtney.henry@example.com', | ||
role: 'Admin' | ||
}, { | ||
id: 3, | ||
name: 'Tom Cook', | ||
title: 'Director of Product', | ||
email: 'tom.cook@example.com', | ||
role: 'Member' | ||
}, { | ||
id: 4, | ||
name: 'Whitney Francis', | ||
title: 'Copywriter', | ||
email: 'whitney.francis@example.com', | ||
role: 'Admin' | ||
}, { | ||
id: 5, | ||
name: 'Leonard Krasner', | ||
title: 'Senior Designer', | ||
email: 'leonard.krasner@example.com', | ||
role: 'Owner' | ||
}, { | ||
id: 6, | ||
name: 'Floyd Miles', | ||
title: 'Principal Designer', | ||
email: 'floyd.miles@example.com', | ||
role: 'Member' | ||
}] | ||
</script> | ||
|
||
<template> | ||
<UTable :columns="columns" :rows="people" /> | ||
</template> |
68 changes: 68 additions & 0 deletions
68
docs/components/content/examples/TableExampleColumnsSelectable.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,68 @@ | ||
<script setup> | ||
const columns = [{ | ||
key: 'id', | ||
label: 'ID' | ||
}, { | ||
key: 'name', | ||
label: 'Name' | ||
}, { | ||
key: 'title', | ||
label: 'Title' | ||
}, { | ||
key: 'email', | ||
label: 'Email' | ||
}, { | ||
key: 'role', | ||
label: 'Role' | ||
}] | ||
const selectedColumns = ref([...columns]) | ||
const people = [{ | ||
id: 1, | ||
name: 'Lindsay Walton', | ||
title: 'Front-end Developer', | ||
email: 'lindsay.walton@example.com', | ||
role: 'Member' | ||
}, { | ||
id: 2, | ||
name: 'Courtney Henry', | ||
title: 'Designer', | ||
email: 'courtney.henry@example.com', | ||
role: 'Admin' | ||
}, { | ||
id: 3, | ||
name: 'Tom Cook', | ||
title: 'Director of Product', | ||
email: 'tom.cook@example.com', | ||
role: 'Member' | ||
}, { | ||
id: 4, | ||
name: 'Whitney Francis', | ||
title: 'Copywriter', | ||
email: 'whitney.francis@example.com', | ||
role: 'Admin' | ||
}, { | ||
id: 5, | ||
name: 'Leonard Krasner', | ||
title: 'Senior Designer', | ||
email: 'leonard.krasner@example.com', | ||
role: 'Owner' | ||
}, { | ||
id: 6, | ||
name: 'Floyd Miles', | ||
title: 'Principal Designer', | ||
email: 'floyd.miles@example.com', | ||
role: 'Member' | ||
}] | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<div class="flex px-3 py-3.5 border-b border-gray-200 dark:border-gray-700"> | ||
<USelectMenu v-model="selectedColumns" :options="columns" multiple placeholder="Columns" /> | ||
</div> | ||
|
||
<UTable :columns="selectedColumns" :rows="people" /> | ||
</div> | ||
</template> |
63 changes: 63 additions & 0 deletions
63
docs/components/content/examples/TableExampleColumnsSortable.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,63 @@ | ||
<script setup> | ||
const columns = [{ | ||
key: 'id', | ||
label: 'ID' | ||
}, { | ||
key: 'name', | ||
label: 'Name', | ||
sortable: true | ||
}, { | ||
key: 'title', | ||
label: 'Title', | ||
sortable: true | ||
}, { | ||
key: 'email', | ||
label: 'Email', | ||
sortable: true | ||
}, { | ||
key: 'role', | ||
label: 'Role' | ||
}] | ||
const people = [{ | ||
id: 1, | ||
name: 'Lindsay Walton', | ||
title: 'Front-end Developer', | ||
email: 'lindsay.walton@example.com', | ||
role: 'Member' | ||
}, { | ||
id: 2, | ||
name: 'Courtney Henry', | ||
title: 'Designer', | ||
email: 'courtney.henry@example.com', | ||
role: 'Admin' | ||
}, { | ||
id: 3, | ||
name: 'Tom Cook', | ||
title: 'Director of Product', | ||
email: 'tom.cook@example.com', | ||
role: 'Member' | ||
}, { | ||
id: 4, | ||
name: 'Whitney Francis', | ||
title: 'Copywriter', | ||
email: 'whitney.francis@example.com', | ||
role: 'Admin' | ||
}, { | ||
id: 5, | ||
name: 'Leonard Krasner', | ||
title: 'Senior Designer', | ||
email: 'leonard.krasner@example.com', | ||
role: 'Owner' | ||
}, { | ||
id: 6, | ||
name: 'Floyd Miles', | ||
title: 'Principal Designer', | ||
email: 'floyd.miles@example.com', | ||
role: 'Member' | ||
}] | ||
</script> | ||
|
||
<template> | ||
<UTable :columns="columns" :rows="people" /> | ||
</template> |
63 changes: 63 additions & 0 deletions
63
docs/components/content/examples/TableExampleSearchable.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,63 @@ | ||
<script setup> | ||
const people = [{ | ||
id: 1, | ||
name: 'Lindsay Walton', | ||
title: 'Front-end Developer', | ||
email: 'lindsay.walton@example.com', | ||
role: 'Member' | ||
}, { | ||
id: 2, | ||
name: 'Courtney Henry', | ||
title: 'Designer', | ||
email: 'courtney.henry@example.com', | ||
role: 'Admin' | ||
}, { | ||
id: 3, | ||
name: 'Tom Cook', | ||
title: 'Director of Product', | ||
email: 'tom.cook@example.com', | ||
role: 'Member' | ||
}, { | ||
id: 4, | ||
name: 'Whitney Francis', | ||
title: 'Copywriter', | ||
email: 'whitney.francis@example.com', | ||
role: 'Admin' | ||
}, { | ||
id: 5, | ||
name: 'Leonard Krasner', | ||
title: 'Senior Designer', | ||
email: 'leonard.krasner@example.com', | ||
role: 'Owner' | ||
}, { | ||
id: 6, | ||
name: 'Floyd Miles', | ||
title: 'Principal Designer', | ||
email: 'floyd.miles@example.com', | ||
role: 'Member' | ||
}] | ||
const q = ref('') | ||
const filteredRows = computed(() => { | ||
if (!q.value) { | ||
return people | ||
} | ||
return people.filter((person) => { | ||
return Object.values(person).some((value) => { | ||
return String(value).toLowerCase().includes(q.value.toLowerCase()) | ||
}) | ||
}) | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<div class="flex px-3 py-3.5 border-b border-gray-200 dark:border-gray-700"> | ||
<UInput v-model="q" placeholder="Filter people..." /> | ||
</div> | ||
|
||
<UTable :rows="filteredRows" /> | ||
</div> | ||
</template> |
45 changes: 45 additions & 0 deletions
45
docs/components/content/examples/TableExampleSelectable.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,45 @@ | ||
<script setup> | ||
const people = [{ | ||
id: 1, | ||
name: 'Lindsay Walton', | ||
title: 'Front-end Developer', | ||
email: 'lindsay.walton@example.com', | ||
role: 'Member' | ||
}, { | ||
id: 2, | ||
name: 'Courtney Henry', | ||
title: 'Designer', | ||
email: 'courtney.henry@example.com', | ||
role: 'Admin' | ||
}, { | ||
id: 3, | ||
name: 'Tom Cook', | ||
title: 'Director of Product', | ||
email: 'tom.cook@example.com', | ||
role: 'Member' | ||
}, { | ||
id: 4, | ||
name: 'Whitney Francis', | ||
title: 'Copywriter', | ||
email: 'whitney.francis@example.com', | ||
role: 'Admin' | ||
}, { | ||
id: 5, | ||
name: 'Leonard Krasner', | ||
title: 'Senior Designer', | ||
email: 'leonard.krasner@example.com', | ||
role: 'Owner' | ||
}, { | ||
id: 6, | ||
name: 'Floyd Miles', | ||
title: 'Principal Designer', | ||
email: 'floyd.miles@example.com', | ||
role: 'Member' | ||
}] | ||
const selected = ref([people[1]]) | ||
</script> | ||
|
||
<template> | ||
<UTable v-model="selected" :rows="people" /> | ||
</template> |
Oops, something went wrong.
cce000a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
ui – ./
ui-git-dev-nuxtlabs.vercel.app
ui.nuxtlabs.com
ui-nuxtlabs.vercel.app