gpt4 book ai didi

vuetify.js - vuetify 表展开箭头出现在左边而不是右边

转载 作者:行者123 更新时间:2023-12-04 16:26:23 32 4
gpt4 key购买 nike

使用 vuetify expanded table但展开箭头在左侧显示为第一项。我怎样才能最后显示它(右侧),如 Expandable rows 所示例子?

 <template>
<v-row justify="center">
<v-dialog
v-model="dialog"
fullscreen
hide-overlay
transition="dialog-bottom-transition"
>
<template v-slot:activator="{ on, attrs }">
<v-col align="center">
<v-btn large light outlined v-bind="attrs" v-on="on">
Add more to inventory
<v-icon right dark>mdi-plus</v-icon>
</v-btn>
<p class="text-caption text-center">Want to sell more services?</p>
</v-col>
</template>
<v-card>
<v-toolbar light>
<v-btn icon light @click="dialog = false">
<v-icon>mdi-close</v-icon>
</v-btn>
<v-spacer></v-spacer>
<v-toolbar-title>Select available services</v-toolbar-title>
</v-toolbar>
<v-container>
<v-col>
<v-text-field
v-model="search"
append-icon="mdi-magnify"
label="Search"
single-line
hide-details
filled
></v-text-field>
</v-col>
<v-data-table
v-model="selected"
:headers="headers"
:items="listings"
:single-select="singleSelect"
item-key="name"
show-select
:single-expand="true"
:expanded.sync="expanded"
show-expand
class="elevation-1"
:search="search"
>
<template v-slot:expanded-item="{ headers, item }">
<td :colspan="headers.length">
More info about {{ item.summary }}
</td>
</template>
</v-data-table>
</v-container>
</v-card>
</v-dialog>
</v-row>
</template>

<script>
export default {
data() {
return {
dialog: false,
expanded: [],
singleSelect: false,
selected: [],
search: '',
headers: [
{
text: 'Service Name',
align: 'start',
sortable: false,
value: 'name',
},
{ text: 'Included items', value: 'subItems' },
{ text: 'Price', value: 'price' },
{ text: 'Status', value: 'status' },
],
listings: [
{
name: 'First item',
subTests: 159,
price: 'Not set',
summary:
'Lorem ipsum',
status: 'Inactive',
},
{
name: Ssecond item',
subTests: 159,
price: 'Not set',
summary:
'Lorem ipsum',
status: 'Inactive',
},
{
name: 'Third item',
subTests: 159,
price: 'Not set',
summary:
'Lorem ipsum dolor',
status: 'Inactive',
},
],
}
},
}
</script>

最佳答案

在查看和测试上面的代码后,我发现如果你添加对象 { text: '', value: 'data-table-expand' } 就可以了。进headers大批。此 docs解释了原因。
基本上从 summary 交换摘要字符串的名称至 data-table-expand .

关于vuetify.js - vuetify 表展开箭头出现在左边而不是右边,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62968540/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com