【发布时间】:2020-03-28 16:29:26
【问题描述】:
我是 Laravel 和 Vue.js 的新手,我正在尝试使用 Vue + Blade 设置 Typescript。每当我访问我的刀片视图时,它只会加载没有任何刀片模板的组件。
app.ts
import Vue from "vue";
import ListClubsComponent from "./components/clubs/list-clubs.vue";
new Vue({
el: "#app",
components: {
"list-clubs": ListClubsComponent
}
});
list.blade.php
@extends('templates.default')
@section('content')
<section id="clubs-container">
<h1>Clubs</h1>
<list-clubs :player="{!! $player !!}"></list-clubs>
</section>
@endsection
default.blade.php
<body>
<div id="app">
@include('templates.header')
<main>
@yield('content')
</main>
@include('templates.footer')
</div>
</body>
如果我不在app.ts 上实例化 Vue,我的刀片模板将正常加载。我只想将 Vue 用于将加载到我的刀片视图中的组件。
【问题讨论】:
标签: javascript php laravel vuejs2 laravel-blade