설치 및 사용방법

설치 및 사용방법

1. 라라벨7 설치

1 composer create-project --prefer-dist laravel/laravel livewiretuto cs

2. 라이브와이어 설치

1 composer require livewire/livewire cs

3. welcome에 라이브와이어 주입하기

1 2 3 4 5 6 7 8 9 10 ... @livewireStyles ... @livewireScripts cs

4. 새구성요소 만들기

1 php artisan livewire:make HelloWorld cs

2개의 파일이 생성된다.

CLASS: app/Http/Livewire/HelloWorld.php

VIEW: resources/views/livewire/hello-world.blade.php

5. view 파일을 간단히 작성해보자(views/livewire/hello-world.blade.php)

1 2 3 HELLO WORLD cs

6. welcome.blade.php파일에 주입해보자

1 @livewire('hello-world') cs

7. 브라우저에서 확인

from http://anko3899.tistory.com/461 by ccl(A) rewrite - 2020-04-11 09:27:14