Skip to content

Commit ca01d95

Browse files
author
Guillaume Chau
committed
fix(ui): PluginAdd tab check
1 parent 33b1e20 commit ca01d95

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

packages/@vue/cli-ui/src/views/ProjectPluginsAdd.vue

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,7 @@ export default {
185185
query: PLUGIN_INSTALLATION,
186186
fetchPolicy: 'netork-only',
187187
result () {
188-
if (this.pluginInstallation.pluginId) {
189-
this.tabId = 'config'
190-
} else {
191-
this.tabId = 'search'
192-
}
188+
this.checkTab()
193189
},
194190
}
195191
},
@@ -203,6 +199,7 @@ export default {
203199
mounted () {
204200
requestAnimationFrame(() => {
205201
this.$refs.searchInput.focus()
202+
this.checkTab()
206203
})
207204
},
208205
@@ -211,6 +208,16 @@ export default {
211208
this.$router.push({ name: 'project-home' })
212209
},
213210
211+
checkTab () {
212+
if (!this.pluginInstallation) return
213+
214+
if (this.pluginInstallation.pluginId) {
215+
this.tabId = 'config'
216+
} else {
217+
this.tabId = 'search'
218+
}
219+
},
220+
214221
async installPlugin () {
215222
try {
216223
await this.$apollo.mutate({

0 commit comments

Comments
 (0)