-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
Copy path579.html
69 lines (64 loc) · 1.35 KB
/
579.html
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<script>
init({
title: 'Issue #579',
desc: 'Show images formatter (<a href="https://github.com/wenzhixin/bootstrap-table/issues/579" target="_blank">#579</a>).',
links: ['bootstrap-table.min.css'],
scripts: [
'https://cdnjs.cloudflare.com/ajax/libs/holder/2.6.0/holder.js',
'bootstrap-table.min.js'
]
})
</script>
<template>
<table
id="table"
data-show-header="false"
data-classes="table table-hover table-no-bordered"
>
<thead>
<tr>
<th
data-field="image"
data-formatter="imageFormatter"
>
Image
</th>
<th data-field="name">
Name
</th>
<th
data-field="action"
data-formatter="actionFormatter"
>
Action
</th>
</tr>
</thead>
</table>
</template>
<script>
const $table = $('#table')
function mounted () {
$table.bootstrapTable({
data: [
{
name: 'Name 1'
},
{
name: 'Name 2'
},
{
name: 'Name 3'
},
{
name: 'Name 4'
},
{
name: 'Name 5'
}
]
})
}
window.imageFormatter = () => '<img src="holder.js/100x150">'
window.actionFormatter = () => '<i class="glyphicon glyphicon-heart"></i> <i class="glyphicon glyphicon-remove"></i>'
</script>