Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
apijson-table: add hook_add, for customizing the add action in apijso…
…n-table component
  • Loading branch information
zhangchunlin committed Sep 19, 2019
commit 2bcdb73fb01692411a445e510bb7d87f80b3d2d8
12 changes: 9 additions & 3 deletions uliweb_apijson/apijson/templates/vue/inc_apijson_table.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
"request_tag", //apijson request tag, default will be same with model name
"config",
"custom_tcolumns_render_generator",
"hook_init",
"hook_ajax_params"
"hook_init", //hook_init(vm), will invoke in mounted()
"hook_ajax_params", //hook_ajax_params(method,action,params), will invoke before ajax action
"hook_add" //hook_add(vm), customize the add action
],
template: `<div>
<div v-if="config_editable && config_add_fields!=null"><i-button type="primary" @click="add">Add</i-button> <br><br> </div>
Expand Down Expand Up @@ -415,7 +416,12 @@
d.value = null
d.component = d.component || "input"
}
this.modal_add = true
if (this.hook_add!=null) {
this.hook_add(this)
}
else {
this.modal_add = true
}
},
real_add: function(){
thisp = this
Expand Down