mirror of
https://github.com/lana-k/sqliteviz.git
synced 2025-12-07 02:28:54 +08:00
fix state updating
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
<button
|
||||
v-if="currentQuery"
|
||||
class="primary"
|
||||
:disabled="currentQuery && !currentQuery.isUnsaved"
|
||||
:disabled="currentQuery && !isUnsaved"
|
||||
@click="checkQueryBeforeSave"
|
||||
>
|
||||
Save
|
||||
@@ -72,6 +72,13 @@ export default {
|
||||
currentQuery () {
|
||||
return this.$store.state.currentTab
|
||||
},
|
||||
isUnsaved () {
|
||||
if (!this.currentQuery) {
|
||||
return false
|
||||
}
|
||||
const tabIndex = this.currentQuery.tabIndex
|
||||
return this.$store.state.tabs[tabIndex].isUnsaved
|
||||
},
|
||||
isPredefined () {
|
||||
if (this.currentQuery) {
|
||||
return this.currentQuery.isPredefined
|
||||
|
||||
Reference in New Issue
Block a user