Skip to content

Commit 2bcdb73

Browse files
committed
apijson-table: add hook_add, for customizing the add action in apijson-table component
1 parent d05064a commit 2bcdb73

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

uliweb_apijson/apijson/templates/vue/inc_apijson_table.html

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
"request_tag", //apijson request tag, default will be same with model name
77
"config",
88
"custom_tcolumns_render_generator",
9-
"hook_init",
10-
"hook_ajax_params"
9+
"hook_init", //hook_init(vm), will invoke in mounted()
10+
"hook_ajax_params", //hook_ajax_params(method,action,params), will invoke before ajax action
11+
"hook_add" //hook_add(vm), customize the add action
1112
],
1213
template: `<div>
1314
<div v-if="config_editable && config_add_fields!=null"><i-button type="primary" @click="add">Add</i-button> <br><br> </div>
@@ -415,7 +416,12 @@
415416
d.value = null
416417
d.component = d.component || "input"
417418
}
418-
this.modal_add = true
419+
if (this.hook_add!=null) {
420+
this.hook_add(this)
421+
}
422+
else {
423+
this.modal_add = true
424+
}
419425
},
420426
real_add: function(){
421427
thisp = this

0 commit comments

Comments
 (0)