【发布时间】:2020-10-19 22:04:14
【问题描述】:
我按照 Laravel 教程安装和使用 VueJs
我安装了:
composer require laravel/ui
php artisan ui bootstrap
php artisan ui vue
npm install
我全部编译:(编译正常,没有错误)
npm run dev
代码:
资源/js/app.js
Vue.component('example-component', require('./components/ExampleComponent.vue').default);
resources/js/components/ExampleComponent.vue
<template>
example from laravel
</template>
资源/视图/layout.blade.php
<head>
<script src="{{ asset('js/app.js')}}"></script>
</head>
<body>
<example-component></example-component>
</body>
我是否缺少某些配置?我不知道我还需要做什么。
页面加载正常我可以看到页面,我可以编写 html/css 进行可视化,但我看不到 Vue 组件。
【问题讨论】: