How do I use Nova components in a custom tool or card?
Asked Answered
W

1

9

I'm currently working on a Laravel Nova application in which I need to add a lot of custom tools and cards. I'd like to keep consistency across the whole application, so it makes sense to simply use the existing Laravel Nova components for certain things like form inputs.

I am trying to use a couple of different components found in the nova/resources/js/fields.js file, but it is not working.

In my code, I am simply referencing the <form-date-time></form-date-time> component, but I am receiving errors:

Cannot read property 'attribute' of undefined
Cannot read property 'value' of undefined

I am not a Vue expert, so I'd imagine there is something pretty clear and obvious I am missing. In another SO post, someone referenced doing the same thing I am trying to do with the Nova checkbox component. In that case, there was a prop that needed to be passed to the component in order for it to function correctly, but I don't see a prop that I need to pass to the component at nova/resources/js/components/Form/DateTimeField.vue.

Any help in using Nova components in my custom tools and cards would be appreciated. Thank you.

Warton answered 7/1, 2020 at 16:6 Comment(0)
L
0

Figured it out. Apparently all the Nova built-in components are available globally. Didn't realize this. All I needed to do to get it to compile was remove the import statement.

Leopoldeen answered 27/9, 2022 at 22:51 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.