vue.js - laravel5.3 vue2 ne semble pas être chargé dans app.js
index.blade directement accessible par le routage laravel
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | <code><!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>
</code>
|
app.js
1 2 3 4 5 6 7 | <code> require ( './bootstrap' );
import App from './components/App.vue' ;
new Vue({
el: '#app' ,
render: h=>h(App)
});
</code>
|
App.Vue
1 2 3 4 5 6 7 8 9 10 11 12 | <code><template>
<p>Hello World</p>
</template>
<script>
export default {
name: 'app'
}
</script>
访问index.blade并没有加载出App.vue的内容
</code>
|

某草草2853 Il y a quelques jours735