11<template >
2- <a-list size =" large" class =" list" :loading =" loading" >
2+ <a-list size =" large" class =" list" :loading =" loading || tabLoading " >
33 <a-list-item :key =" index" v-for =" (item, index) in items" class =" item" >
44 <a-list-item-meta >
55 <span slot =" title" style =" word-break : break-all " ><strong >{{ item.name }}</strong ></span >
1515 @keydown.esc =" editableValueKey = null"
1616 @pressEnter =" updateData(item)" >
1717 </a-input >
18- <span v-else class =" value" >
18+ <span v-else class =" value" @click = " setEditableSetting(item, index) " >
1919 {{ item.value }}
2020 </span >
2121 </div >
@@ -64,7 +64,8 @@ export default {
6464 items: [],
6565 scopeKey: ' ' ,
6666 editableValueKey: null ,
67- editableValue: ' '
67+ editableValue: ' ' ,
68+ tabLoading: false
6869 }
6970 },
7071 beforeMount () {
@@ -95,14 +96,15 @@ export default {
9596 this .fetchData ()
9697 },
9798 watch: {
98- resource : newItem => {
99+ resource : function ( newItem , oldItem ) {
99100 if (! newItem .id ) return
101+ this .resource = newItem
100102 this .fetchData ()
101103 }
102104 },
103105 methods: {
104106 fetchData (callback ) {
105- this .loading = true
107+ this .tabLoading = true
106108 api (' listConfigurations' , {
107109 [this .scopeKey ]: this .resource .id ,
108110 listAll: true
@@ -112,13 +114,13 @@ export default {
112114 console .error (error)
113115 this .$message .error (' There was an error loading these settings.' )
114116 }).finally (() => {
115- this .loading = false
117+ this .tabLoading = false
116118 if (! callback) return
117119 callback ()
118120 })
119121 },
120122 updateData (item ) {
121- this .loading = true
123+ this .tabLoading = true
122124 api (' updateConfiguration' , {
123125 [this .scopeKey ]: this .resource .id ,
124126 name: item .name ,
@@ -133,7 +135,7 @@ export default {
133135 description: ' There was an error saving this setting. Please try again later.'
134136 })
135137 }).finally (() => {
136- this .loading = false
138+ this .tabLoading = false
137139 this .fetchData (() => {
138140 this .editableValueKey = null
139141 })
0 commit comments