Laravel - paginacion con laravel, no se mestran los valores

 
Vista:

paginacion con laravel, no se mestran los valores

Publicado por jose (1 intervención) el 26/02/2020 02:59:46
Estoy tratando de paginar los datos de la base de datos, arroja este error

Property or method "bitacora" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See:

Me comenzo a aparecer cuando trato de hacer una paginacion

este es el html

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<div class="col-12" v-show="bitacoras.mostrar">
    <table class="table">
      <thead>
        <tr>
          <th scope="col">Usuario</th>
          <th scope="col">Fecha de Registro</th>
          <th scope="col">Hora de registro</th>
          <th scope="col">Accion Realizada</th>
        </tr>
      </thead>
      <tbody>
        <tr v-if="bitacora in bitacoras.registros">
          <th scope="row">@{{ bitacora.registros.usuario_id }}</th>
          <td>@{{ bitacora.registros.fecha_reg }}</td>
          <td>@{{ bitacora.registros.hora_reg }}</td>
          <td>@{{ bitacora.registros.accion }}</td>
        </tr>
      </tbody>
    </table>
</div>
el js una vez le doy a un boton para que se ejecute

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
buscar: function(e){
 
    self.alert.mostrar = false;
 
    self.formSearch.submit.html = '<i class="fas fa-cog fa-spin"></i>';
    self.formSearch.submit.disabled = true;
 
    axios.get('/buscarBitacora')
    .then(function (response) {
 
    self.formSearch.submit.html = 'Consultar';
    self.formSearch.submit.disabled = false;
 
    if(response.status === 200 && response.data.response === true){
 
        self.bitacoras.mostrar = true;
        self.bitacoras.registros = response.data.bitacoras;
 
    }else{
 
        throw response.data;
 
    }...
la cual me dirige al controlador donde se realizara la paginacion y los ordenara

1
2
3
4
5
6
7
8
9
10
function buscarBitacora(Request $request){
 
     $info = BitacoraModel::orderByDesc('id')->paginate(10);
    if(!empty($info)){
      $response = array("response" => true, "bitacoras" => $info);
    }else{
      $response = array("response" => false, "message" => "No se encontraron resultadoos");
    }
    return $response;
}
y finalmente le model que hace la busqueda en la base de datos y extrae los datos

1
2
3
4
5
6
7
8
9
class BitacoraModel extends Model
{
    /**
     * The database table used by the model.
     *
     * @var string
     */
    protected $table = 'tbl_bitacora';
}
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder