所以我最近只使用 Laravel 框架完成了我的項目?,F(xiàn)在我已經(jīng)完成了它,我想通過在不刷新布局頁面的情況下刷新內(nèi)容來將 vue.js 添加到我的項目中。而且我想將我的刀片文件轉(zhuǎn)換為 vue 組件。我不知道怎么做,因為在我項目的每個部分,我有 4 個刀片文件,如索引、編輯、創(chuàng)建、顯示,我不知道如何在組件中制作它,而且很難因為我使用的是 laravel 集體形式,這就是為什么每次我向數(shù)據(jù)庫添加一些條目時它都會刷新。我也是 vuejs 的新手。有人可以幫我解決這個問題嗎?非常感謝。我的文件夾目錄是這樣的。-roadmap---index.blade.php---show.blade.php---edit.blade.php---create.blade.php這是我的一些代碼。路線圖/index.blade.php@extends('layouts.admin')@section('content')<meta name="csrf-token" content="{{ csrf_token() }}"><!-- DATA TABLES --><script src="//code.jquery.com/jquery-1.12.3.js"></script><script src="//cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script><script src="https://cdn.datatables.net/1.10.12/js/dataTables.bootstrap.min.js"></script><link rel="stylesheet"href="https://cdn.datatables.net/1.10.12/css/dataTables.bootstrap.min.css"><div><a class="btn btn-success" style="float:right" href="{{ route('roadmap.create') }}">Add Roadmap</a></div><table id="myTable" class="table table-hover"> <thead> <tr> <th scope="col">ID</th> <th scope="col">Year Covered </th> <th scope="col">Description</th> <th scope="col">Date entered</th> <th width="280px">Action</th> </tr> </thead> <tbody> @foreach ($roadmap as $data) <tr> <td>{{ $data->id }}</td> <td>{{ $data->year}}</td> <td>{{ $data->body}}</td> <td>{{ $data->created_at}}</td> <td> <a href="/roadmap/{{$data->id}}/edit" class="btn btn-warning"><span class="glyphicon glyphicon-pencil"></span></a> <a href="/roadmap/{{$data->id}}" class="btn btn-primary"><span class="glyphicon glyphicon-search"></span></a> {!! Form::open(['method' => 'DELETE', 'route'=>['roadmap.destroy', $data->id], 'style'=> 'display:inline', 'onsubmit' => 'return confirm("Are you sure you want to delete?")']) !!} {!! Form::button('<i class="fa fa-trash"></i>',['type'=>'submit', 'class'=> 'btn btn-danger']) !!} {!! Form::close() !!}</td>@endsection
Laravel 刀片模板更改為 vue 組件
溫溫醬
2021-08-20 10:20:23