Topic: VueJs

VueJs Dynamic Class and Style Bindings 0

VueJs Dynamic Class and Style Bindings

VueJs Dynamic Class and Style Bindings

In this Post We Will Explain About is VueJs Dynamic Class and Style Bindings With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to Step By Step: Attribute and Class Binding in vuejs Example

In this post we will show you Best way to implement javascript – Vue.js: Conditional class styling, hear for Dynamic conditional style binding in vue js to toggle a class with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Dynamic Styles With Vue.js

index.html

<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/vue/dist/vue.js"></script>

<script>
new Vue({
	el: '#liveApp',
  data: {
  	extraStyles: {
    	'border-radius': '12px'
    }
  },
  computed: {
  	liveStyles: function() {
    	var height = 300;
    
    	return {
  	  	'background-color': 'green',
	      width: (height / 2) + 'px',
      	height: height + 'px'
    	};
    }
  }
});
</script>

</head>
<body>
<h2>Dynamic Styles With Vue.js</h2>
<div id="liveApp">
  <div v-bind:style="[liveStyles, extraStyles]"></div>
</div>
</body>
</html>

Class and Style Bindings in Vue.js

Dynamic Add Class With Vue.js

index.html

<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.24/vue.min.js"></script>
<script>
new Vue({
	el: '#liveApp',
  data:{
  	liveClass: false
  }
});

</script>
</head>
<body>

<h1>Pakainfo.com - VueJs Class Binding</h1>
<div id="liveApp">
  <label for="liver1">Change Your Text background colors</label><input type="checkbox" v-model="liveClass" id="liver1">
  <br><br>
  <div v-bind:class="{'liveClass': liveClass}">
    Your are most welcome in Pakainfo.com - v-bind:class
  </div>
</div>
<style>
body{
  font-size: 2rem;
  font-family: arial;
}

.liveClass{
  background: #c60000;
  color: #fff;
}
</style>
</body>
</html>

Dynamic Styles With Vue.js

You are Most welcome in my youtube Channel Please subscribe my channel. and give me FeedBack.
More Details……
Angularjs Example

Example

I hope you have Got What is VueJs Dynamic Class and Style Bindings And how it works.I would Like to have FeedBack From My Blog(Pakainfo.com) readers.Your Valuable FeedBack,Any Question,or any Comments about This Article(Pakainfo.com) Are Most Always Welcome.

Automatically Refresh/Reload Page using VueJS Example 0

Automatically Refresh/Reload Page using VueJS Example

Automatically Refresh/Reload Page using VueJS Example

In this Post We Will Explain About is Automatically Refresh/Reload Page using VueJS Example With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to Vue JS and Auto Page Refresh Example

In this post we will show you Best way to implement Auto refresh page refresher, automatically refresh using vuejs, hear for vuejs Automatically Refresh HTML page or div after some Interval with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Automatically Refresh a Page Using Vuejs

Vuejs simple example of the Automatically Refresh HTML page or div after some Interval

new Vue({ 
	el: 'live24u',

	data: {
	},

	ready: function() {
		this.mymsg();
	},

	methods: {
			    studentUpdate: function () {
                    this.$http.get('/webapi/student').then((results) => {
                        console.log(results.data.data);
                        this.student = results.data.data;
                    }, (results) => {
                        console.log('ERROR');
                        console.log(results);
                    });
                    setTimeout(this.studentUpdate, 5000);
                }
		},

})

Example 2 : Vue JS and Auto Page Refresh

simple make a page auto refresh or reload after a certain some x second amount of second

methods: {
	studentUpdate: function () {
		this.$http.get('/webapi/student').then((results) => {
			console.log(results.data.data);
			this.student = results.data.data;
		}, (results) => {
			console.log('ERROR');
			console.log(results);
		});
		setTimeout(this.studentUpdate, 5000);
	}
},
ready() {
	this.studentUpdate();
}

You are Most welcome in my youtube Channel Please subscribe my channel. and give me FeedBack.
More Details……
Angularjs Example

Example

I hope you have Got What is vuejs – How to reload page every 5 second And how it works.I would Like to have FeedBack From My Blog(live24u.com) readers.Your Valuable FeedBack,Any Question,or any Comments about This Article(live24u.com) Are Most Always Welcome.

Accessing Complex Nested JSON objects in VueJs 0

Accessing Complex Nested JSON objects in VueJs

Accessing Complex Nested JSON objects in VueJs

In this Post We Will Explain About is Accessing Complex Nested JSON objects in VueJs With Example and Demo.Welcome on pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to Access to nested JSON property with vue.js Example

In this post we will show you Best way to implement Accessing Nested Objects in Vuejs, hear for Iterating Over nested Items in Vue.js With V-for with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Getting Started for Access to nested JSON property with vue.js

We have used CDN(libes) for Vuejs so you must need Your internet Data connection for them to work on Access to nested JSON property with vue.js.

<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.16/vue.js"></script>

index.html

This is the main HTML view of our Simple Web Application. In here, we have init Base declared all our simple my this Example(Iterating Over nested Items in Vue.js With V-for) dependencies and the HTML Elements that we have created.

<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.16/vue.js"></script>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>Iterating Over nested Items in Vue.js With V-for - pakainfo.com</title>
</head>
<body id="pakainfo">
<h2>Access nested JSON property with VueJS</h2>
<template v-for="all_students_list in live_schools">
  <tr>
       <td>{{all_students_list.view.name}}</td>
  </tr>
</template>
</body>
</html>

index.js

This contains our simple custom index.js files Add Like as javascript, vuejs scripts

///How to access nested data objects using vue?
var pakainfo = new Vue({
  el: '#pakainfo',
  data: {
    live_schools: [
   {
      "id":1,
      "student_id":1,
      "view_id":1,
      "schoolstd_id":1,
      "student_class_id":1,
      "stude_status":false,
      "view":{
         "id":1,
         "name":"Krunal Sisodariya",
         "schoolstd_id":1,
         "stude_status":false
      }
   },
   {
      "id":2,
      "student_id":1,
      "view_id":2,
      "schoolstd_id":1,
      "student_class_id":1,
      "stude_status":false,
      "view":{
         "id":2,
         "name":"Jaydeep Gondaliya",
         "schoolstd_id":1,
         "stude_status":false
      }
   },
   {
      "id":3,
      "student_id":1,
      "view_id":3,
      "schoolstd_id":1,
      "student_class_id":1,
      "stude_status":false,
      "view":{
         "id":3,
         "name":"Rakesh Bhanderi",
         "schoolstd_id":1,
         "stude_status":true
      }
   }
]
  }
})

Access nested JSON property with VueJS

You are Most welcome in my youtube Channel Please subscribe my channel. and give me FeedBack.
More Details……
Angularjs Example

Example

I hope you have Got What is Accessing Nested Objects in Vuejs And how it works.I would Like to have FeedBack From My Blog(pakainfo.com) readers.Your Valuable FeedBack,Any Question,or any Comments about This Article(pakainfo.com) Are Most Always Welcome.

Simple VueJS Responsive Image Carousel Slider 0

Simple VueJS Responsive Image Carousel Slider

Simple VueJS Responsive Image Carousel Slider

Today, We want to share with you Simple VueJS Responsive Image Carousel Slider.
In this post we will show you Vue Carousel Slider Control, hear for Building an Image Slider with Vue.js we will give you demo and example for implement.
In this post, we will learn about vue-slider-component – npm with an example.

Getting Started for Vue Carousel 3d – Dynamic props

We have used CDN(libes) for vuejs so you must need Your internet Data connection for them to work on Vue Carousel.

https://cdnjs.cloudflare.com/ajax/libs/vue/2.1.7/vue.js
https://rawgit.com/Wlada/vue-carousel-3d/master/dist/vue-carousel-3d.min.js

index.html

This is the main HTML view of our Simple Web Application. In here, we have init Base declared all our simple my this Example(Recreating a simple carousel slider) dependencies and the HTML Elements that we have created.

/*
Devloped by : pakainfo.com
-------------------------
Date : 		25-04-2020
Developer:  Jaydeep Gondaliya
Web-Site:   pakainfo.com
Script:		vuejs,HTML,PHP,JS,CSS
File:       index.php/index.html
*/
<h3>vue-slider-component</h3>
<div id="pakaApp">
  <carousel-3d :perspective="180" :controls-visible="true" :width="600" :display="1">
    <slide v-for="(slide, i) in slides" :index="i">
      <span class="title">Pakainfo.com</span>
      <p>Simple VueJS Dynamic Carousel Slider Control Example</p>
    </slide>
  </carousel-3d>
</div>

index.js

This contains our simple custom index.js files Add Like as javascript, vuejs scripts

new Vue({
  el: '#pakaApp',
  data: {
    slides: 8
  },
  components: {
    'carousel-3d': Carousel3d.Carousel3d,
    'slide': Carousel3d.Slide
  }
})

style.css

Last step, we have add the Following CSS styles for our simple vue-slider-component and our Custom styling.

.carousel-3d-container {
  .carousel-3d-slide {
    padding: 22px;
    .title { font-size: 25px; }
  }
}

vue-slider-component

We hope you get an idea about Vue.js Carousel & Slider Components
We would like to have feedback on my Information blog .
Your valuable any feedback, Good question, Inspirational Quotes, or Motivational comments about this article are always welcome.
If you liked this post, Please don’t forget to share this as Well as Like FaceBook Page.

We hope This Post can help you…….Good Luck!.

Simple VueJS Tree Menu Expandable 0

Simple VueJS Tree Menu Expandable

Simple VueJS Tree Menu Expandable

Today, We want to share with you Simple VueJS Tree Menu Expandable.
In this post we will show you A Vue.js tree navigation menu, hear for Dynamic Category Subcategory Tree using VueJS we will give you demo and example for implement.
In this post, we will learn about Vue.js Expandable Tree Menu with an example.

Getting Started for VueJS Tree Menu

We have used CDN(libes) for vuejs so you must need Your internet Data connection for them to work on Dynamic Category Subcategory Tree using VueJS.

<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.16/vue.js"></script>

index.html

This is the main HTML view of our Simple Web Application. In here, we have init Base declared all our simple my this Example(Vue.js Expandable Tree Menu) dependencies and the HTML Elements that we have created.

<div class="pakainfo container">
  <h4>how to create dynamic tree view in Vuejs</h4>
  <div id="PakaApp">
  <live-tree 
             :nodes="tree.nodes" 
             :depth="0"   
             :label="tree.label"
             ></live-tree>
  </div>
</div>


<script type="text/x-template" id="live-tree">
  <div class="live-tree">
    <div class="label-wrPakaApper" @click="subcatToggle">
      <div :style="indent" :class="labelClasses">
        <i v-if="nodes" class="fa" :class="myCustomClass"></i>
        {{ label }}
      </div>
    </div>
    <live-tree 
      v-if="subcategory"
      v-for="mycat in nodes" 
      :nodes="mycat.nodes" 
      :label="mycat.label"
      :depth="depth + 1"   
    >
    </live-tree>
  </div>
</script>

index.js

This contains our simple custom index.js files Add Like as javascript, vuejs scripts

let tree = {
  label: 'root',
  nodes: [
    {
      label: 'product1',
      nodes: [
        {
          label: 'product1.1'
        },
        {
          label: 'product1.2',
          nodes: [
            {
              label: 'product1.2.1'
            }
          ]
        }
      ]
    }, 
    {
      label: 'item2'  
    }
  ]
}

Vue.component('live-tree', { 
  template: '#live-tree',
  props: [ 'nodes', 'label', 'depth' ],
  data() {
     return {
       subcategory: false
     }
  },
  computed: {
    myCustomClass() {
      return {
        'fa-plus-square-o': !this.subcategory,
        'fa-minus-square-o': this.subcategory
      }
    },
    labelClasses() {
      return { 'has-children': this.nodes }
    },
    indent() {
      return { transform: `translate(${this.depth * 50}px)` }
    }
  },
  methods: {
    subcatToggle() {
       this.subcategory = !this.subcategory;
    }
  }
});

new Vue({
  el: '#PakaApp',
  data: {
    tree
  }
})

style.css

Last step, we have add the Following CSS styles for our simple vuejs tree menu Expandable Custom Style and our Custom styling.

body {
  font-family: "Open Sans", sans-serif;
  font-size: 17px;
  font-weight: 600;
  line-height: 1em;
}

.container {
  width: 350px;
  margin: 0 auto;
}

.live-tree {
  .label-wrPakaApper {
    padding-bottom: 9px;
    margin-bottom: 9px;
    border-bottom: 1px solid #3d3d3d;
    .has-children {
      cursor: pointer;
    }
  }
}

We hope you get an idea about Treeview using Bootstrap Treeview, Vuejs and JavaScript
We would like to have feedback on my Information blog .
Your valuable any feedback, Good question, Inspirational Quotes, or Motivational comments about this article are always welcome.
If you liked this post, Please don’t forget to share this as Well as Like FaceBook Page.

We hope This Post can help you…….Good Luck!.

vue js Accessing Complex Nested JSON objects 0

vue js Accessing Complex Nested JSON objects

vue js Accessing Complex Nested JSON objects

Today, We want to share with you vue js Accessing Complex Nested JSON objects.
In this post we will show you How to access nested data objects in vue.js?, hear for Access to nested JSON property with vue.js we will give you demo and example for implement.
In this post, we will learn about Accessing Complex Nested JSON objects in vuejs with an example.

Include External Libs

Getting Started for Access to nested JSON property with vue.js

We have used CDN(libes) for vuejs so you must need Your internet Data connection for them to work on Accessing Complex Nested JSON objects in vuejs.

<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.16/vue.js"></script>

index.html

This is the main HTML purchase of our Simple Web Application. In here, we have init Base declared all our simple my this Example(vuejs complex json object) dependencies and the HTML Elements that we have created.

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="purchaseport" content="width=device-width">
  <title>Accessing Complex Nested JSON objects in vuejs</title>
</head>
<body id="paka_prod">
<template v-for="my_purchase in products_details">
  <tr>
       <td>{{my_purchase.purchase.name}}</td>
  </tr>
</template>
</body>
</html>

Javascript Source code

This contains our simple custom index.js files Add Like as javascript, vuejs scripts with JSON Data

var paka_prod = new Vue({
  el: '#paka_prod',
  data: {
    products_details: [
   {
      "id":1,
      "product_id":1,
      "purchase_id":1,
      "item_id":1,
      "product_item_id":1,
      "status":false,
      "purchase":{
         "id":1,
         "name":"Computer",
         "item_id":1,
         "status":false
      }
   },
   {
      "id":2,
      "product_id":1,
      "purchase_id":2,
      "item_id":1,
      "product_item_id":1,
      "status":false,
      "purchase":{
         "id":2,
         "name":"Mobile",
         "item_id":1,
         "status":false
      }
   },
   {
      "id":3,
      "product_id":1,
      "purchase_id":3,
      "item_id":1,
      "product_item_id":1,
      "status":false,
      "purchase":{
         "id":3,
         "name":"Laptop",
         "item_id":1,
         "status":true
      }
   }
]
  }
})

We hope you get an idea about Vuex best Example for complex objects
We would like to have feedback on my Information blog .
Your valuable any feedback, Good question, Inspirational Quotes, or Motivational comments about this article are always welcome.
If you liked this post, Please don’t forget to share this as Well as Like FaceBook Page.

We hope This Post can help you…….Good Luck!.

Simple Vue.js 2 CRUD application 0

Simple Vue.js 2 CRUD application

Simple Vue.js 2 CRUD application

Today, We want to share with you Simple Vue.js 2 CRUD application.
In this post we will show you Build a Basic CRUD App with Vue.js and Node, hear for Creating a simple CRUD application with Laravel 5 and Vue.js 2 we will give you demo and example for implement.
In this post, we will learn about Basic CRUD Operations Using Vue.js Example with an example.

index.html

simple source code for DOM Html elements

<html lang="en">
<head>
  <meta charset="utf-8">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  <title>Vue.js CRUD application</title>
  <meta name="postDesc" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>

<div class="container">
  <header class="page-header">
    <div class="branding">
      <img src="https://vuejs.org/images/logo.png" alt="Logo" title="Home page" class="logo"/>
      <h1>Vue.js 2 CRUD application</h1>
      <p>Ported from: <a href="https://codepen.io/-a/pen/amOYGp">Vue.js CRUD application</a></p>
    </div>
  </header>
  <main id="app">
    <router-view></router-view>
  </main>
</div>

<template id="post-list">
  <div>
    <div class="actions">
      <router-link class="btn btn-default" v-bind:to="{path: '/add-post'}">
        <span class="glyphicon glyphicon-plus"></span>
        Add post
      </router-link>
    </div>
    <div class="filters row">
      <div class="pakainfo form-group grp col-sm-3">
        <label for="search-element">Post name</label>
        <input v-model="searchKey" class="pakainfo form-control gid" id="search-element" requred/>
      </div>
    </div>
    <table class="table">
      <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
        <th>Price</th>
        <th class="col-sm-2">Actions</th>
      </tr>
      </thead>
      <tbody>
      <tr v-for="post in filteredPosts">
        <td>
          <router-link v-bind:to="{name: 'post', params: {post_id: post.id}}">{{ post.name }}</router-link>
        </td>
        <td>{{ post.postDesc }}</td>
        <td>
          {{ post.pview }}
          <span class="glyphicon glyphicon-euro" aria-hidden="true"></span>
        </td>
        <td>
          <router-link class="btn btn-warning btn-xs" v-bind:to="{name: 'post-edit', params: {post_id: post.id}}">Edit</router-link>
          <router-link class="btn btn-danger btn-xs" v-bind:to="{name: 'post-delete', params: {post_id: post.id}}">Remove</router-link>
        </td>
      </tr>
      </tbody>
    </table>
  </div>
</template>

<template id="add-post">
  <div>
    <h2>Add new post</h2>
    <form v-on:submit="createPost">
      <div class="pakainfo form-group grp">
        <label for="add-name">Name</label>
        <input class="pakainfo form-control gid" id="add-name" v-model="post.name" required/>
      </div>
      <div class="pakainfo form-group grp">
        <label for="add-postDesc">Description</label>
        <textarea class="pakainfo form-control gid" id="add-postDesc" rows="10" v-model="post.postDesc"></textarea>
      </div>
      <div class="pakainfo form-group grp">
        <label for="add-pview">Price, <span class="glyphicon glyphicon-euro"></span></label>
        <input type="number" class="pakainfo form-control gid" id="add-pview" v-model="post.pview"/>
      </div>
      <button type="submit" class="btn btn-primary">Create</button>
      <router-link class="btn btn-default" v-bind:to="'/'">Cancel</router-link>
    </form>
  </div>
</template>

<template id="post">
  <div>
    <h2>{{ post.name }}</h2>
    <b>Description: </b>
    <div>{{ post.postDesc }}</div>
    <b>Price:</b>
    <div>{{ post.pview }}<span class="glyphicon glyphicon-euro"></span></div>
    <br/>
    <span class="glyphicon glyphicon-arrow-left" aria-hidden="true"></span>
    <router-link v-bind:to="'/'">Back to post list</router-link>
  </div>
</template>

<template id="post-edit">
  <div>
    <h2>Edit post</h2>
    <form v-on:submit="updatePost">
      <div class="pakainfo form-group grp">
        <label for="edit-name">Name</label>
        <input class="pakainfo form-control gid" id="edit-name" v-model="post.name" required/>
      </div>
      <div class="pakainfo form-group grp">
        <label for="edit-postDesc">Description</label>
        <textarea class="pakainfo form-control gid" id="edit-postDesc" rows="3" v-model="post.postDesc"></textarea>
      </div>
      <div class="pakainfo form-group grp">
        <label for="edit-pview">Price, <span class="glyphicon glyphicon-euro"></span></label>
        <input type="number" class="pakainfo form-control gid" id="edit-pview" v-model="post.pview"/>
      </div>
      <button type="submit" class="btn btn-primary">Save</button>
      <router-link class="btn btn-default" v-bind:to="'/'">Cancel</router-link>
    </form>
  </div>
</template>

<template id="post-delete">
  <div>
    <h2>Remove post {{ post.name }}</h2>
    <form v-on:submit="deletePost">
      <p>The action cannot be undone.</p>
      <button type="submit" class="btn btn-danger">Remove</button>
      <router-link class="btn btn-default" v-bind:to="'/'">Cancel</router-link>
    </form>
  </div>
</template>

</body>
</html>

index.js

all the included javascript source code

var posts = [
  {id: 1, name: 'Angular', postDesc: 'happy bday wala janamdivash mubark ho apko', pview: 100},
  {id: 2, name: 'Ember', postDesc: 'I love you my sweet hart.', pview: 100},
  {id: 3, name: 'React', postDesc: 'my best and dear sweet hart i miss u.', pview: 100}
];

function findPost (postId) {
  return posts[findPostKey(postId)];
};

function findPostKey (postId) {
  for (var key = 0; key < posts.length; key++) {
    if (posts[key].id == postId) {
      return key;
    }
  }
};

var List = Vue.extend({
  template: '#post-list',
  data: function () {
    return {posts: posts, searchKey: ''};
  },
  computed: {
    filteredPosts: function () {
      return this.posts.filter(function (post) {
        return this.searchKey=='' || post.name.indexOf(this.searchKey) !== -1;
      },this);
    }
  }
});

var Post = Vue.extend({
  template: '#post',
  data: function () {
    return {post: findPost(this.$route.params.post_id)};
  }
});

var PostEdit = Vue.extend({
  template: '#post-edit',
  data: function () {
    return {post: findPost(this.$route.params.post_id)};
  },
  methods: {
    updatePost: function () {
      var post = this.post;
      posts[findPostKey(post.id)] = {
        id: post.id,
        name: post.name,
        postDesc: post.postDesc,
        pview: post.pview
      };
      router.push('/');
    }
  }
});

var postRemove = Vue.extend({
  template: '#post-delete',
  data: function () {
    return {post: findPost(this.$route.params.post_id)};
  },
  methods: {
    deletePost: function () {
      posts.splice(findPostKey(this.$route.params.post_id), 1);
      router.push('/');
    }
  }
});

var AddPost = Vue.extend({
  template: '#add-post',
  data: function () {
    return {post: {name: '', postDesc: '', pview: ''}}
  },
  methods: {
    createPost: function() {
      var post = this.post;
      posts.push({
        id: Math.random().toString().split('.')[1],
        name: post.name,
        postDesc: post.postDesc,
        pview: post.pview
      });
      router.push('/');
    }
  }
});

var router = new VueRouter({routes:[
  { path: '/', component: List},
  { path: '/post/:post_id', component: Post, name: 'post'},
  { path: '/add-post', component: AddPost},
  { path: '/post/:post_id/edit', component: PostEdit, name: 'post-edit'},
  { path: '/post/:post_id/delete', component: postRemove, name: 'post-delete'}
]});
app = new Vue({
  router:router
}).$mount('#app')

style.css

cusome css available

.logo {
  width: 78px;
  float: left;
  margin-right: 16px;
}

.pakainfo form-group grp {
  max-width: 600px;
}

.actions {
  padding: 11px 0;
}

.glyphicon-euro {
  font-size: 13px;
}

We hope you get an idea about Simple Vue.js 2 CRUD application
We would like to have feedback on my Information blog .
Your valuable any feedback, Good question, Inspirational Quotes, or Motivational comments about this article are always welcome.
If you liked this post, Please don’t forget to share this as Well as Like FaceBook Page.

We hope This Post can help you…….Good Luck!.

vuejs crud Insert Update Delete operations Example and demo 0

vuejs crud Insert Update Delete operations Example and demo

vuejs crud Insert Update Delete operations Example and Demo

Today, We want to share with you vuejs crud Insert Update Delete operations Example and demo.
In this post we will show you vuejs CRUD operations demo example, hear for Simple VueJs 2.0 CRUD Operations Application we will give you demo and example for implement.
In this post, we will learn about vuejs insert update delete Example – vuejs crud example with an example.

Include CDN

We have used Some CDN for Bootstrap and Vue JS so First You need Online internet connection for them to step by step work.

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://wzrd.in/bundle/[email protected]"></script>
<script src="https://unpkg.com/[email protected]/dist/vue.min.js"></script>

index.html(HTML Markup Languages)

Simple Main index file Data Contains for Vue.js CRUD application.This is our index.html file that Data contains our sample Vue Barcode that we are going to vuejs crud Insert Update Delete operations Example and demo with component.

<html lang="en">
<head>
  <meta charset="utf-8">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  <title>Simple Vue.js CRUD application Step By Step</title>
  <meta name="information" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>

<div class="pakainfo container">
  <header class="page-header">
    <div class="branding">
      <img src="https://vuejs.org/images/logo.png" alt="Logo" title="Home page" class="logo"/>
      <h1>Simple Vue.js CRUD application Step By Step</h1>
    </div>
  </header>
  <div class="alert alert-warning">
    <strong>Outdated!</strong> Vue 2 Data implementation can be found <a href="https://codepen.io/mevdschee/pen/BpbEbj">here</a>.
  </div>
  <main id="app">
    <router-view></router-view>
  </main>
</div>

<template id="student-list">
  <div class="actions">
    <a class="btn btn-default" v-link="{path: '/add-student'}">
      <span class="glyphicon glyphicon-plus"></span>
      Add student
    </a>
  </div>
  <div class="filters row">
    <div class="form-group col-sm-3">
      <label for="search-element">Student name</label>
      <input v-model="searchKey" class="form-control" id="search-element" requred/>
    </div>
  </div>
  <table class="table">
    <thead>
    <tr>
      <th>Name</th>
      <th>Information</th>
      <th>Age</th>
      <th class="col-sm-2">Actions</th>
    </tr>
    </thead>
    <tbody>
    <tr v-for="student in students | filterBy searchKey in 'name'">
      <td>
        <a v-link="{name: 'student', params: {student_id: student.id}}">{{ student.name }}</a>
      </td>
      <td>{{ student.information }}</td>
      <td>
        {{ student.age }}
        <span class="glyphicon glyphicon-euro" aria-hidden="true"></span>
      </td>
      <td>
        <a class="btn btn-warning btn-xs" v-link="{name: 'student-edit', params: {student_id: student.id}}">Edit</a>
        <a class="btn btn-danger btn-xs" v-link="{name: 'student-delete', params: {student_id: student.id}}">Delete</a>
      </td>
    </tr>
    </tbody>
  </table>
</template>

<template id="add-student">
  <h2>Add new student</h2>
  <form v-on:submit="addStudent">
    <div class="form-group">
      <label for="add-name">Name</label>
      <input class="form-control" id="add-name" v-model="student.name" required/>
    </div>
    <div class="form-group">
      <label for="add-information">Information</label>
      <textarea class="form-control" id="add-information" rows="10" v-model="student.information"></textarea>
    </div>
    <div class="form-group">
      <label for="add-age">Age, <span class="glyphicon glyphicon-euro"></span></label>
      <input type="number" class="form-control" id="add-age" v-model="student.age"/>
    </div>
    <button type="submit" class="btn btn-success">Create</button>
    <a v-link="'/'" class="btn btn-default">Cancel</a>
  </form>
</template>

<template id="student">
  <h2>{{ student.name }}</h2>
  <b>Information: </b>
  <div>{{ student.information }}</div>
  <b>Age:</b>
  <div>{{ student.age }}<span class="glyphicon glyphicon-euro"></span></div>
  <br/>
  <span class="glyphicon glyphicon-arrow-left" aria-hidden="true"></span>
  <a v-link="'/'">Backt to student list</a>
</template>

<template id="student-edit">
  <h2>Edit student</h2>
  <form v-on:submit="updateStudent">
    <div class="form-group">
      <label for="edit-name">Name</label>
      <input class="form-control" id="edit-name" v-model="student.name" required/>
    </div>
    <div class="form-group">
      <label for="edit-information">Information</label>
      <textarea class="form-control" id="edit-information" rows="3" v-model="student.information"></textarea>
    </div>
    <div class="form-group">
      <label for="edit-age">Age, <span class="glyphicon glyphicon-euro"></span></label>
      <input type="number" class="form-control" id="edit-age" v-model="student.age"/>
    </div>
    <button type="submit" class="btn btn-success">Save</button>
    <a v-link="'/'" class="btn btn-default">Cancel</a>
  </form>
</template>

<template id="student-delete">
  <h2>Delete student {{ student.name }}</h2>
  <form v-on:submit="removeStudent">
    <p>The action cannot be undone.</p>
    <button type="submit" class="btn btn-danger">Delete</button>
    <a v-link="'/'" class="btn btn-default">Cancel</a>
  </form>
</template>

</body>
</html>

index.js

This contains our index.js scripts.

var students = [
  {id: 1, name: 'Jaydeep', information: 'Jaydeep Gondaliya is an Indian computer programmer and Internet Master.', age: 100},
  {id: 2, name: 'Krunal', information: 'Krunal Sisodiya is an Indian Master business Management', age: 100},
  {id: 3, name: 'Ankit', information: 'Ankit Kathiriya is a SAP ABAP Live24u.com Consultant at VC Best ERP Lives in Rajkot.', age: 100}
];

function findStudent (productId) {
  return students[findStudentKey(productId)];
};

function findStudentKey (productId) {
  for (var key = 0; key < students.length; key++) {
    if (students[key].id == productId) {
      return key;
    }
  }
};

var List = Vue.extend({
  template: '#student-list',
  data: function () {
    return {students: students, searchKey: ''};
  }
});

var Student = Vue.extend({
  template: '#student',
  data: function () {
    return {student: findStudent(this.$route.params.student_id)};
  }
});

var StudentEdit = Vue.extend({
  template: '#student-edit',
  data: function () {
    return {student: findStudent(this.$route.params.student_id)};
  },
  methods: {
    updateStudent: function () {
      var student = this.$get('student');
      students[findStudentKey(student.id)] = {
        id: student.id,
        name: student.name,
        information: student.information,
        age: student.age
      };
      router.go('/');
    }
  }
});

var StudentDelete = Vue.extend({
  template: '#student-delete',
  data: function () {
    return {student: findStudent(this.$route.params.student_id)};
  },
  methods: {
    removeStudent: function () {
      students.splice(findStudentKey(this.$route.params.student_id), 1);
      router.go('/');
    }
  }
});

var AddStudent = Vue.extend({
  template: '#add-student',
  data: function () {
    return {student: {name: '', information: '', age: ''}
    }
  },
  methods: {
    addStudent: function() {
      var student = this.$get('student');
      students.push({
        id: Math.random().toString().split('.')[1],
        name: student.name,
        information: student.information,
        age: student.age
      });
      router.go('/');
    }
  }
});

var router = new VueRouter();
router.map({
  '/': {component: List},
  '/student/:student_id': {component: Student, name: 'student'},
  '/add-student': {component: AddStudent},
  '/student/:student_id/edit': {component: StudentEdit, name: 'student-edit'},
  '/student/:student_id/delete': {component: StudentDelete, name: 'student-delete'}
})
  .start(Vue.extend({}), '#app');

Style.css

It data contains of the Custom CSS styling.

.logo {
  width: 55px;
  float: left;
  margin-right: 14px;
}

.form-group {
  max-width: 600px;
}

.actions {
  padding: 11px 0;
}

.glyphicon-euro {
  font-size: 13px;
}

Here All Source Code and Example Download For “VueJS CRUD (Create Read Update Delete) Operation” – Basic CRUD Operations Using VueJS

We hope you get an idea about vuejs insert update delete Example – vuejs crud example
We would like to have feedback on my Information blog .
Your valuable any feedback, Good question, Inspirational Quotes, or Motivational comments about this article are always welcome.
If you liked this post, Please don’t forget to share this as Well as Like FaceBook Page.

We hope This Post can help you…….Good Luck!.

vue-barcode – Vuejs Barcode Generator Script Download 0

vue-barcode - Vuejs Barcode Generator Script Download

vue-barcode – Vuejs Barcode Generator Script Download

Today, We want to share with you vue-barcode – Vuejs Barcode Generator Script Download.
In this post we will show you Flexible Barcode Generator In Vue.js, hear for Vuejs – Barcode generator written in vue we will give you demo and example for implement.
In this post, we will learn about How to Import Barcodescanner in Vuejs component with an example.

Include CDN

We have used Some CDN for Bootstrap and Vue JS so First You need Online internet connection for them to step by step work.

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://wzrd.in/bundle/[email protected]"></script>
<script src="https://unpkg.com/[email protected]/dist/vue.min.js"></script>

HTML Markup Languages

This is our index.html file that Data contains our sample Vue Barcode that we are going to Generating Barcodes with the Vue Barcode componen.

<div id="Pakainfo">
  <input v-model="livebarcodeVal" /><br>
  <barcode v-bind:value="livebarcodeVal" font-options="bold">
    Can't Your generate the barcode for Pakainfo.com
  </barcode>
</div>

Script Data contains Files(index.js)

This contains our index.js scripts.

var VueBarcode = require('vue-barcode');

var Pakainfo = new Vue({
  el: '#Pakainfo',
  data: {
    livebarcodeVal: 'test',
  },
  components: {
		'barcode': VueBarcode
	}
})

Full Example : Flexible Barcode Generator In Vue.js

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Generating Barcodes with the Vue Barcode componen</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://wzrd.in/bundle/[email protected]"></script>
  <script src="https://unpkg.com/[email protected]/dist/vue.min.js"></script>
</head>
<body>
<div id="Pakainfo">
  <input v-model="livebarcodeVal" /><br>
  <barcode v-bind:value="livebarcodeVal" font-options="bold">
    Can't generate the barcode
  </barcode>
</div>

<script>
var VueBarcode = require('vue-barcode');
var Pakainfo = new Vue({
  el: '#Pakainfo',
  data: {
    livebarcodeVal: 'Pakainfo.com',
  },
  components: {
		'barcode': VueBarcode
	}
})
</script>
</body>
</html>

Simple You can Demo and Output Please This Link Simple Barcode Generator For Vue.js

We hope you get an idea about How to Import Barcodescanner in Vuejs component
We would like to have feedback on my Information blog .
Your valuable any feedback, Good question, Inspirational Quotes, or Motivational comments about this article are always welcome.
If you liked this post, Please don’t forget to share this as Well as Like FaceBook Page.

We hope This Post can help you…….Good Luck!.