Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

apijson-viewedit: add loading spin#49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
TommyLemon merged 1 commit intoAPIJSON:masterfromzhangchunlin:master
Mar 29, 2020
Merged
Show file tree
Hide file tree
Changes fromall 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
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,7 +9,7 @@
"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
"hook_viewedit" //hook_viewedit(vm), customize theadd action
"hook_viewedit" //hook_viewedit(vm, params), customize theview edit 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
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,7 +9,8 @@
"hook_init",
"hook_ajax_params"
],
template: `
template: `<div>
<Spin size="large" fix v-if="loading"></Spin>
<i-form @submit.native.prevent :label-width="80">
<form-item v-for="item in viewedit_items" :key="item.key" :label="item.title">
<i-input v-if="item.component=='input'" v-model="item.value" :readonly="!editable(item)"></i-input>
Expand All@@ -21,11 +22,12 @@
<i-button type="info" icon="ios-download" size="large" @click="save">Save</i-button>
</form-item>
</i-form>
`,
</div>`,
data: function(){
return {
l_request_tag: null,
role: "{{=role or ''}}",
loading: false,
row: {},
row_saved: {},
viewedit_items: [],
Expand All@@ -36,6 +38,7 @@
},
methods: {
init_viewedit: function(){
this.loading = true
var params = {}
var model_params = {
"id":this.id
Expand All@@ -51,6 +54,7 @@
contentType: 'application/json',
data: JSON.stringify(params),
success: function (data) {
thisp.loading = false
if (data.code==200) {
thisp.row = data[thisp.model_name]
thisp.row_saved = thisp.row
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp