index.blade, auf den direkt über Laravel-Routing zugegriffen wird
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>Dashboard</title>
<script>
window.Laravel = {
csrfToken: "{{ csrf_token() }}"
};
</script>
</head>
<body>
<p id="app"></p>
<script src="{{ elixir('js/app.js') }}"></script>
</body>
</html>
app.js
require('./bootstrap');
import App from './components/App.vue';
new Vue({
el: '#app',
render: h=>h(App)
});
App.Vue
<template>
<p>Hello World</p>
</template>
<script>
export default {
name: 'app'
}
</script>
访问index.blade并没有加载出App.vue的内容
求各路大神指点。。。
假设你执行了
npm install
和gulp
,然后index.blade.php
文件中加入<App></App>