QMarkupTable 是一种简单封装原生 <table>
的方法,使其看起来像 Material Design 表格。
¥The QMarkupTable is a way for you to simply wrap a native <table>
in order to make it look like a Material Design table.
提示
对于分页、排序、过滤等高级功能,你可能需要查看 QTable 组件。
¥For advanced functionality like pagination, sorting, filtering, and many more, you may want to check out QTable component instead.
用法(Usage)
¥Usage
警告
请注意,QMarkupTable
的内容反映了原生 HTML <table>
的准确标记表示,其中 <thead>
和 <tbody>
分别用于包裹表头和表体。这是必需的。
¥Notice that the content of QMarkupTable
reflects an accurate markup representation of a native HTML <table>
, having a <thead>
and <tbody>
to wrap header and table body. This is required.
UMD 开发者
此组件在 Quasar 的 UMD 版本中无法按原样工作。浏览器会在 Vue 启动并渲染之前解析模板 HTML,因此标记必须正确。<q-markup-table> <thead>
或 <q-markup-table> <tbody>
不是。解决方案是将内容封装在 <template>
中,如下所示:
¥This component will NOT work as-is within the UMD version of Quasar. Browsers parse the template HTML before Vue kicks in and renders it, so the markup needs to be correct. <q-markup-table> <thead>
or <q-markup-table> <tbody>
is not. The solution is to wrap the content in a <template>
like the following:
<q-markup-table>
<template>
<!-- your content -->
</template>
</q-markup-table>
提示
如果你想移除某些行或单元格的悬停效果,请为它们添加 q-tr--no-hover
或 q-td--no-hover
类。
¥If you want to remove the hover effect on some rows or some cells add a q-tr--no-hover
or q-td--no-hover
class to them.