Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/meteor/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Laravel Blade中使用Vue标记?_Laravel_Vue.js_Balde - Fatal编程技术网

如何在Laravel Blade中使用Vue标记?

如何在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">

嗨,伙计们

我在我的Laravel项目中使用Vue。如果我在Blade中使用Vue componet,它可以工作:

<!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(),
});
感谢您的回答:

  • Vue未定义…如何修复它
  • 在Laravel Blade中使用Vue是错误的吗
  • 如果这是错误的方法,请告诉我正确的方法

  • 如果您在输入标记中像v-model那样编写,那么它工作了吗?谢谢,但问题仍然存在:Vue未定义如果您在输入标记中像v-model那样编写,那么它工作了吗?谢谢,但问题仍然存在:Vue未定义