-
|
User.php public function actions(NovaRequest $request)
{
return [
Action::modal('Preview', 'PreviewResourceModal', [
'resourceName' => 'users',
'resourceId' => '1',
])->withoutConfirmation()->showInline()
];
}1、ajax http://127.0.0.1:8000/nova-api/users/action?action=preview&pivotAction=false&search=&filters=W3siQXBwXFxOb3ZhXFxGaWx0ZXJzXFxTZWxlY3QiOiIifV0%3D&trashed= How to give PreviewResourceModal props |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
|
Check the code, the name of the props attribute is :data, which is incompatible with built-in components and only suitable for modal components written by yourself |
Beta Was this translation helpful? Give feedback.
-
<component
v-if="responseModalVisible"
:show="responseModalVisible"
:is="actionResponseData?.modal"
@confirm="handleResponseModalConfirm"
@close="handleResponseModalClose"
:data="actionResponseData"
/>
|
Beta Was this translation helpful? Give feedback.
-
|
Personally, I suggest adding a modal component to Nova.Index. Subcomponents can share state with the Nova.Index component, which can reduce the accumulation of web pages |
Beta Was this translation helpful? Give feedback.
-
|
This is not the correct way to use |
Beta Was this translation helpful? Give feedback.
This is not the correct way to use
Action::modal(), you should instead create a custom Preview modal instead of hacking onPreviewResourceModaland expecting everything to just work.