简体   繁体   中英

Nested Folder Dynamic Component - Laravel Blade

Trying to use a dynamic component in order to pass in a variable and get to the component file I need. However, the component files are nested in another folder inside the components folder. I'm unable to do the normal <x-foldername.file /> since it is a dynamic component.

Is there a different way to go into a subfolder using dynamic components? Below is an example of the component call I'm currently doing that won't work with the file in the subfolder.

<x-dynamic-component:component="$component_variable":data="$data" />

Ok I figured it out.

<x-dynamic-component :component="'foldername.' . $component_variable" :data="$data"/>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM