vue.js - Vuetify 渲染标签而不是类名
问题描述
我正在使用 vuetify 中的 v 卡,但意识到当我使用相同的标记进行我的操作时,与代码笔中的示例相比,我的“v-list-item”呈现不同。一些 CSS 样式也没有遵循。有没有人经历过这个?
<v-card
class="mx-auto"
max-width="344"
outlined
>
<v-list-item three-line>
<v-list-item-content>
<div class="overline mb-4">OVERLINE</div>
<v-list-item-title class="headline mb-1">Headline 5</v-list-item-title>
<v-list-item-subtitle>Greyhound divisely hello coldly fonwderfully</v-list-item-subtitle>
</v-list-item-content>
<v-list-item-avatar
tile
size="80"
color="grey"
></v-list-item-avatar>
</v-list-item>
<v-card-actions>
<v-btn text>Button</v-btn>
<v-btn text>Button</v-btn>
</v-card-actions>
</v-card>
解决方案
尝试将列表项包装在父 v-list 组件中。
<v-card
class="mx-auto"
max-width="344"
>
<v-list> <!-- NOTE THE PARENT COMPONENT!!! -->
<v-list-item three-line>
<v-list-item-content>
<div class="overline mb-4">OVERLINE</div>
<v-list-item-title class="headline mb-1">Headline 5</v-list-item-title>
<v-list-item-subtitle>Greyhound divisely hello coldly fonwderfully</v-list-item-subtitle>
</v-list-item-content>
<v-list-item-avatar
tile
size="80"
color="grey"
></v-list-item-avatar>
</v-list-item>
</v-list>
<v-card-actions>
<v-btn text>Button</v-btn>
<v-btn text>Button</v-btn>
</v-card-actions>
</v-card>
但它所做的只是为块添加边距。
请更新您的笔。它是空的。
推荐阅读
- excel - 通过将活动单元格的范围提供给列的最后一行来显示自动填充命令范围中的错误
- process - 无法编译任何东西,无论正文如何,这是我得到的消息
- python - python:使用序列号编写 CSV 文件
- javascript - 如何通过转换使 div 在提交时消失?
- mysql - 存储多个值 MySQL
- android - android studio - 不需要的无限错误日志
- javascript - 根据元素获取数据
- html - 为什么我的整篇文章在 flex 容器中时会溢出它的边界?
- python - Pyspark 动态过滤数据框
- python - 有时即使循环任务结束,循环线程也会卡住而没有结束