Category: Vue.js

Vue js Wrapper Component

When you integrate your Vue.js with third party component you have to use technique called Wrapper Component. In this article we will see how we can use jQuery plugin inside the Vue I will integrate Select2 https://select2.org/ with Vue If you use jQuery you can use the following code in your javascript code so that […]

Read more

Vue-Pass DOM elements to child component with SLOTS

In Vue.js SLOTS can be used to pass DOM elements to child components. This is very easy concept to understand with following example. In your child component template you have to use

where your parent component can inject the DOM elements

Read more

How to use vue resource to upload file

In this article we will study how we can use vue-resource library to upload file to the back-end server. I am using following HTML template to start. I have used following scripts in header section of the HTML

First one is for the Vue The second script for the vue-resource which I use to […]

Read more

How to post array of data to the server in your Vue app

When you develop the Vue application you will have to post array of data to the REST API url given to you Suppose you are going to make a invoice with several products as shown in the following HTML code

Now I want to submit this HTML table Server I have update_products function inside […]

Read more

REST API route in Laravel redirect to login page

I have built the REST api for my Vue.js application and I have used the Laravel Passport authentication to authenticate the API end point I have the following code snippet in my routes/api.php file. It basically return array of post when I call the URL http://localhost/api/posts provides that you have correct authentication. I am calling […]

Read more

Select Box binding in Vue

In this example we will see how we can bind the Select Box to Vue You can have the following Vue instance

Here, you will have the days array and selectedday to hold the value selected from the select box Now your HTML code should look as below

In this HTML code you […]

Read more

Check box binding in Vue js

In this lesson we will see how to bind check box in Vue when you build interface. We will see how to create product category and bind them to check boxes. Also we will see how to set the default category. First we will create the category array inside the data segment of the Vue […]

Read more

Vue Event Bus to communicate sibling components

303 total views, 3 views today

303 total views, 3 views today

Read more

How get query parameter in Vue

If you have url something like this htttp://mysite.com/products?page=2#vendor/2 how do you get the vendor id You can use the following code $this.route.params.id

Read more

Pass parameter from child component to parent in Vue

When you work with Vue.js components you will have to pass paramets from child components to parant through events We have the following Vue component

You have text field with v-model=’fname’ Button has the click event and I am going to pass the fname to the function parentfunc in parent element This is the […]

Read more