0
The structure of my project is like this:
The main layout page is this, this is where I get the file Vue, Axios and the app:
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Administração de Imóveis</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <style>
body { padding-top: 70px; }
</style>
</head>
<body><!--O id do Vue.JS -->
<div>
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Início</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a href="">Todos</a></li>
<li><a href="">Apartamentos</a></li>
<li><a href="">Casas</a></li>
<li><a href="">Kitnet</a></li>
</ul>
</div>
</div>
</nav>
<div class="container">
@yield('content')
</div>
</div>
<script src="{{asset('lib/vue/dist/vue.js')}}"></script>
<script src="{{asset('lib/axios/dist/axios.js')}}"></script>
<script src="{{asset('lib/axios/jquery/dist/jquery.js')}}"></script>
<script src="{{asset('lib/app.js')}}"></script>
</body>
</html>
This is the page
@extends('app')
@section('content')
<div id="crud" class="row">
<div class="col-xs-12">
<h1 class="page-header">Lista de Imoveis</h1>
</div>
<div class="col-sm-7">
<a href="#" class="btn btn-primary pull-right">Novo Imovel</a>
<table class="table table-hover table-striped">
<thead>
<tr>
<th>Id</th>
<th>Descrição</th>
<th colspan="2"> </th>
</tr>
</thead>
<tbody>
<tr v-for="dado in dados" >
<td width="10px">1</td>
<td>descrição</td>
<td width="10px">
<a href="#" class="btn btn-warning btn-success">Editar</a>
</td>
<td width="10px">
<a href="#" class="btn btn- btn-danger">Eliminar</a>
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-sm-5">
<pre>
@{{ data }}
</pre>
</div>
</div>
@endsection
I wonder where I went wrong?
Check and an error appears in the browser console. There is the lib folder inside
resources/assets
?– Andre Gusmao
Maybe the problem is not this @Andréluizdegusmão. From what I understand of Laravel, the files should be inside the folder
public/js
. It would not be the case that AP did not run Gulp or npm?– Wallace Maxters
What is the version of Laravel?
– Wallace Maxters