config: allow custom action component needs to be in popup

When custom component is specified for an action, allow boolean option
to display that component either in a popup or in routable component.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2019-09-25 11:17:15 +05:30
parent c4d20938f7
commit 0bd0fe2880
2 changed files with 4 additions and 3 deletions

View File

@ -16,6 +16,7 @@ export default {
icon: 'plus',
label: 'Add Zone',
listView: true,
popup: true,
component: () => import('@/views/infra/ZoneWizard.vue')
}
]

View File

@ -90,16 +90,16 @@
:visible="showAction"
:closable="true"
style="top: 20px;"
@ok="handleSubmit"
@cancel="closeAction"
:confirmLoading="currentAction.loading"
:footer="null"
centered
>
<component :is="currentAction.component"/></component>
</a-modal>
</keep-alive>
<a-modal
v-else
:title="currentAction.label"
:visible="showAction"
:closable="true"
@ -369,7 +369,7 @@ export default {
this.currentAction = {}
},
execAction (action) {
if (action.component && action.api) {
if (action.component && action.api && !action.popup) {
this.$router.push({ name: action.api })
return
}