我在一个demo中,引入了Bootstrap.min.css 样式文件,
在写表格组件的时候,其他的都有效,唯独table 无效;
解决办法:
添加上<thead>
和<tbody>
标签
表头结构和数据结构如下:
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32head: [ { key: 'id', title: 'ID' }, { key: 'name', title: "姓名" }, { key: 'age', title: "年龄" } ], data: [ { id: '01', name: '任重道远', age: '22' }, { id: '02', name: '木叶下', age: '21' }, { id: '03', name: '郭德纲', age: '47' }, ],
循环的时候:(嵌套循环)
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13<table class='table'> <thead> <tr> <td v-for="item in head">{{item.title}}</td> </tr> </thead> <tbody> <tr v-for="item in data"> <td v-for="h in head">{{item[h.key]}}</td> </tr> </tbody> </table>
最后
以上就是自由枕头最近收集整理的关于Vue中引入Bootstrap的样式文件,Table没有样式+(表格循环的结构)的全部内容,更多相关Vue中引入Bootstrap内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复