【发布时间】:2019-08-29 09:58:49
【问题描述】:
我正在开发我的 vue.js 项目,并且正在使用 Vuetify。 现在,我已经从文档中制作了一个类似于此示例的数据表:
https://codepen.io/pen/?&editable=true&editors=101
我希望使用带有 - 和 + 按钮的同一个表格(正如您在代码笔中看到的,在类别名称周围)。
当我在浏览器中检查代码时,似乎有某种按钮,但它们没有显示 codepen 示例模板中的按钮。
有人知道如何实现吗?
这是来自代码笔的代码:
<div id="app">
<v-app id="inspire">
<v-data-table
:headers="headers"
:items="desserts"
item-key="name"
group-by="category"
class="elevation-1"
show-group-by
></v-data-table>
</v-app>
</div>
new Vue({
el: '#app',
vuetify: new Vuetify(),
data () {
return {
headers: [
{
text: 'Dessert (100g serving)',
align: 'left',
value: 'name',
},
{ text: 'Category', value: 'category' },
],
desserts: [
{
name: 'Frozen Yogurt',
category: 'Ice cream',
},
{
name: 'Ice cream sandwich',
category: 'Ice cream',
},
{
name: 'Eclair',
category: 'Cookie',
},
{
name: 'Cupcake',
category: 'Pastry',
},
{
name: 'Gingerbread',
category: 'Cookie',
},
{
name: 'Jelly bean',
category: 'Candy',
},
{
name: 'Lollipop',
category: 'Candy',
},
{
name: 'Honeycomb',
category: 'Toffee',
},
{
name: 'Donut',
category: 'Pastry',
},
{
name: 'KitKat',
category: 'Candy',
},
],
}
},
})
我的代码看起来像示例,除了 - 和 + 按钮具有奇怪的文本而不是示例中显示的图标。
【问题讨论】:
-
奇怪的文字而不是图标指向丢失的字体 - 只是一个想法
-
@Estradiaz 当然,但由于 codepen 中没有提供 css,我认为它与 Vuetify 的一般工作方式有关。但是由于我已经将这个示例复制到我自己的代码中,并且看起来完全一样 - 我不知道发生了什么。
标签: vue.js vuetify.js