Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9a55c69

Browse files
committed
when not editable, not show 'delete' button
1 parent d95c0c5 commit 9a55c69

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

uliweb_apijson/apijson/templates/vue/inc_apijson_table.html

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,19 @@
3838
"action": {
3939
title: 'Action',
4040
width: 140,
41-
render: (h, params) => {
42-
return h('div', [
41+
render: function(h, params){
42+
var delete_button = h('Button', {
43+
props: {
44+
type: 'error',
45+
size: 'small'
46+
},
47+
on: {
48+
click: function(){
49+
thisp.remove(params)
50+
}
51+
}
52+
}, 'Delete')
53+
var buttons = [
4354
h('Button', {
4455
props: {
4556
type: 'primary',
@@ -53,19 +64,12 @@
5364
thisp.show(params)
5465
}
5566
}
56-
}, this.viewedit_label),
57-
h('Button', {
58-
props: {
59-
type: 'error',
60-
size: 'small'
61-
},
62-
on: {
63-
click: function(){
64-
thisp.remove(params)
65-
}
66-
}
67-
}, 'Delete')
68-
]);
67+
}, thisp.viewedit_label)
68+
]
69+
if (thisp.config_editable) {
70+
buttons.push(delete_button)
71+
}
72+
return h('div', buttons);
6973
}
7074
}
7175
},

0 commit comments

Comments
 (0)