component에 추가내용 전달하기

component에 추가내용 전달하기

1. welcome.blade.php 추가내용을 추가한다.

>

body

>

sidebar

-

x

>

div

추가내용

>

"

border-solid border-4 border-red-500

"

class=

div

< div class= " border-solid border-4 border-red-500 " > 추가내용

>

"

bg-gray-500

"

class=

"

$info

"

=

info

"

My Sidebar

"

=

title

sidebar

-

x

< x - sidebar title = " My Sidebar " : info = " $info " class= " bg-gray-500 " >

>

"

flex flex-col items-center

"

class=

body

< body class= " flex flex-col items-center " >

2. sidebar.blade.php 삽입할 곳에 {{ $slot }} 를 입력한다.

< div {{ $attributes -> merge ([ ' class ' => ' text-xl ' ])}} >

< h1 > {{ $title }}

< h3 > {{ $info }}

< p class= " text-pink-200 " > Hello Laravel 7 Component

< ul >

@ foreach ( $ list ( ' 저는 리스트 매개변수입니다 ' ) as $item )

< li > {{ $item }}

@ endforeach

{{ $slot }}

from http://anko3899.tistory.com/439 by ccl(A) rewrite - 2021-10-28 00:26:45