Is it possible to merge to values and put into one column in v-data-table?
List.vue
<template>
<v-app>
<v-data-table
:items="items"
:headers="headers"
/>
</v-app>
</template>
<script>
export default {
data() {
return {
items: [
{ first_name: "Peter", last_name: "Johnson" },
{ first_name: "Simon", last_name: "Walker" }
],
headers: [
{ text: "first_name", value: "first_name" },
{ text: "last_name", value: "last_name" },
]
};
}
};
</script>
For example I want to put Peter Johnson
in Full name
column of my v-data-table, While it doesn't have Full name
column.
You can style the content inside your Vuetify data table rows as per your requirement using Typography classes. I've added onclick listener on the tr tag that toggles the value key of the particular row item which is bound to the star icon. So inside the methods in your JS I've added the toggle function:
The architecture of a table is such that a user can quickly scan the displayed information. A data table organizes information using column and rows, and a general DataTable has the following components: Create Vue project by using the following command. Get inside the project directory.
Add a search prop to enable filtering feature in Data Tables is very easy in Vue with Vuetify.js. Start the app in the browser. Finally, we have completed the Vue Table tutorial with various examples, and i hope you liked this tutorial.
03-24-2019 11:30 PM First, if you use SQL tables, then you shoud apply full outer join to combine both the columns from the tables and create a dataset in Power BI. Second, if you Datasource is like Excel,etc.. then you can append both the dataset in Power BI query editor.
You can render a virtual column with the use of slots with v-data-table
. But you need to have a column full_name
.
<v-data-table :headers="headers" :items="items">
<template #item.full_name="{ item }">{{ item.first_name }} {{ item.last_name }}</template>
</v-data-table>
export default {
data() {
return {
items: [
{ first_name: "Peter", last_name: "Johnson" },
{ first_name: "Simon", last_name: "Walker" }
],
headers: [{ text: "Full Name", value: "full_name" }]
};
}
};
https://vuetifyjs.com/en/components/data-tables#slots
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With