diff --git a/Inertia.php b/Inertia.php index e668ee9..1e5da37 100644 --- a/Inertia.php +++ b/Inertia.php @@ -22,6 +22,9 @@ class Inertia extends Component /** @var string */ public $view = '@tebe/inertia/views/inertia'; + + /** @var string */ + public $rootElementId = 'app'; /** * @inheritDoc diff --git a/README.md b/README.md index 1a5f5c1..97eba6a 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ return [ 'components' => [ 'inertia' => [ 'class' => 'tebe\inertia\Inertia' + 'rootElementId' => 'app' // optional per https://inertiajs.com/client-side-setup#defining-a-root-element ], 'request' => [ 'cookieValidationKey' => '', diff --git a/views/inertia.php b/views/inertia.php index 7a6188e..2347486 100644 --- a/views/inertia.php +++ b/views/inertia.php @@ -1,4 +1,4 @@ -
+