如何在Laravel Blade中使用Vue标记?
嗨,伙计们强> 我在我的Laravel项目中使用Vue。如果我在Blade中使用Vue componet,它可以工作:如何在Laravel Blade中使用Vue标记?,laravel,vue.js,balde,Laravel,Vue.js,Balde,嗨,伙计们 我在我的Laravel项目中使用Vue。如果我在Blade中使用Vue componet,它可以工作: <!doctype html> <html lang="en"> <head> ... <link href="{{ asset('css/app.css') }}" rel="stylesheet"> ... </head> <body> <div id="app">
<!doctype html>
<html lang="en">
<head>
...
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
...
</head>
<body>
<div id="app">
<!-- it works -->
<example-component></example-component>
</div>
<script src="{{ asset('js/app.js') }}" defer></script>
</body>
</html>
...
...
但是,如果我直接在Blade中使用Vue标记,它将不起作用:
<!doctype html>
<html lang="en">
<head>
...
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
...
</head>
<body>
<div id="app">
<!-- it dosen't work: Uncaught ReferenceError: Vue is not defined at index(xx) -->
<v-app>
<v-btn color="primary">I'm a Vue Button</v-btn>
</v-app>
</div>
<script src="{{ asset('js/app.js') }}" defer></script>
<script>
const app = new Vue({
el: '#app',
vuetify: new Vuetify(),
});
</script>
</body>
</html>
...
...
我是一个Vue按钮
const app=新的Vue({
el:“#应用程序”,
vuetify:新的vuetify(),
});
感谢您的回答:
如果您在输入标记中像v-model那样编写,那么它工作了吗?谢谢,但问题仍然存在:Vue未定义如果您在输入标记中像v-model那样编写,那么它工作了吗?谢谢,但问题仍然存在:Vue未定义