admin管理员组文章数量:1389758
I am trying to setup VueJs using laravel 5.7 and mix and it just says VueJs not detected. I have run npm install
. Here is my wele view:
<!doctype html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Laravel</title>
<link rel="stylesheet" href=".7.2/css/bulma.css">
<style type="text/css">body { padding-top: 40px; }</style>
</head>
<body>
<div id="root" class="container">
<message title="Hello World" body="Lorem ipsum dolor sit amet."></message>
</div>
</body>
</html>
here is my app js:
require('./bootstrap');
window.Vue = require('vue');
Vueponent('message', require('./ponents/Message.vue'));
const app = new Vue({
el: '#root'
});
I can't figure out why VueJs won't work. Any help would be greatly appreciated. Thank you!
I am trying to setup VueJs using laravel 5.7 and mix and it just says VueJs not detected. I have run npm install
. Here is my wele view:
<!doctype html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Laravel</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare./ajax/libs/bulma/0.7.2/css/bulma.css">
<style type="text/css">body { padding-top: 40px; }</style>
</head>
<body>
<div id="root" class="container">
<message title="Hello World" body="Lorem ipsum dolor sit amet."></message>
</div>
</body>
</html>
here is my app js:
require('./bootstrap');
window.Vue = require('vue');
Vue.ponent('message', require('./ponents/Message.vue'));
const app = new Vue({
el: '#root'
});
I can't figure out why VueJs won't work. Any help would be greatly appreciated. Thank you!
Share Improve this question asked Oct 17, 2018 at 15:54 L. FoxL. Fox 3541 gold badge7 silver badges20 bronze badges 2- You don't have any script tag in your view.. – Devon Bessemer Commented Oct 17, 2018 at 16:04
- ah ok thank you! the simplest things! – L. Fox Commented Oct 17, 2018 at 16:06
3 Answers
Reset to default 5As said, you missed the script tag.
If you are piling your sources you should use mix()
rather than asset()
, as it will respect things such as file versioning with mix.version()
.
e.g.
<script src="{{ mix('/js/app.js') }}"></script>
you need to add this script in your index.blade.php
<script src="{{ asset('/js/app.js') }}"></script>
thanks , this make the magic
<script src="{{ mix('/js/app.js') }}"></script>
in laravel I place it inside the blade HTML and then reload the page , F12 and there was the vue tab working and now I can see the tags of vue.
本文标签: javascriptVueJs not detected in Laravel using MixStack Overflow
版权声明:本文标题:javascript - VueJs not detected in Laravel using Mix - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744716823a2621453.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论