Home > PHP Framework > Laravel > Does laravel support vue?

Does laravel support vue?

(*-*)浩
Release: 2019-10-30 11:01:00
Original
3220 people have browsed it

Before we start learning to use Vue.js, we must first introduce it into our Laravel project. Here I choose the simplest way, Directly download the corresponding open version JS file (http://vuejs.org/js/ vue.js), and then place the downloaded vue.js file into the js directory under the public directory (create it if there is no js directory).

Does laravel support vue?

Hello World (Recommended learning: laravel development)

Like any other language/framework learning, let's start by printing Hello World, and at the same time we will learn one of Vue's functional features: data binding.

We use the view file welcome.blade.php provided by Laravel as a demonstration file. Before starting, introduce vue.js before :

<script type="text/javascript" src="{{asset(&#39;js/vue.js&#39;)}}"></script>
Copy after login

Then we edit welcome. The content of the blade.php file is as follows:

<div class="container">
     <div class="content">
         <div class="title">
             <p>@{{ message }}</p>
         </div>
     </div>
 </div>
Copy after login

Write some js code at the same time:

<script type="text/javascript">
      new Vue({
         el: &#39;.title&#39;,
         data: {
             message: &#39;Hello Laravel!&#39;
         }
     })
 </script>
Copy after login

The above is the detailed content of Does laravel support vue?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template