我想用 laravel livewire 做一个 SPA,我想使用 wire:click 来触发组件中的一个功能,但它不起作用,如果我第一次在这里发布代码混乱,请原谅,我不确定要发布什么这是我的代码来解决这些问题谢谢
主.blade.php
@section('content')
<div>
<div class="row justify-content-center">
<div class="col-12">
<div class="card my-3">
<!-- header -->
<div class="card-header d-inline-flex">
<h3 class='mr-2'>Categories</h3>
<div>
<a href="javascript:void(0);" wire:click='createCategory' class="btn btn-success ">Add NewCategory</a>
</div>
</div><!-- header -->
<div class="card-body">
<!-- alerts -->
@include('admin.includes.alerts.errors')
@include('admin.includes.alerts.success')
<!-- alerts -->
<!-- if True , create form will show , if not will stay disabled -->
@if ($showCreateForm)
@livewire('admin.category.create' )
@endif
<!-- if True , create form will show , if not will stay disabled -->
<!-- Table -->
<div class="table-responsive">
<table id="example2" class="table table-bordered table-hover">
<thead>
<tr>
<th>ID</th>
<th>Image</th>
<th>Name</th>
<th>Slug</th>
<th>Status</th>
<th>Parent</th>
<th>Action</th>
</tr>
</thead>
<tbody>
斯蒂芬大帝
慕标琳琳
一只甜甜圈
慕妹3242003
繁花如伊
相关分类