尽管有以下教程,但我的Vue组件未在页面上呈现。我有以下布局(master.blade.php):
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="/favicon.ico">
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>Mileage</title>
<link rel="stylesheet" href="{{ mix('/css/app.css') }}" media="all">
</head>
<body>
<div id="app">
<example-component></example-component>
</div>
<script src="{{ mix('/js/app.js') }}"></script>
</body>
</html>
布局由以下控制器返回(我使用CAS登录):
<?php
namespace App\Http\Controllers;
use App\LkpStaff;
use Illuminate\Http\Request;
class AuthController extends Controller
{
public function login()
{
if (!cas()->isAuthenticated())
{
cas()->authenticate();
}
$user = cas()->user();
$dbUser = LkpStaff::where('user_name', $user)->first(['staff_refid']);
if ($dbUser)
{
$userId = $dbUser->staff_refid;
}else
{
$userId = $this->createNewUser($user);
}
session()->put('casUser', $user);
session()->put('userId', $userId);
return view('master', [
'casUser' => $user,
'userId' => $userId
]);
}
}
如您所见,该组件未呈现。控制台中也没有错误。除了创建新项目,我还能做些什么?
扬帆大鱼
皈依舞