Vue add del

Developer
Size
2,236 Kb
Views
12,144

How do I make an vue add del?

What is a vue add del? How do you make a vue add del? This script and codes were developed by Eric on 07 December 2022, Wednesday.

Vue add del Previews

Vue add del - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>vue add del</title>
</head>
<body>
<div id="app"> <div> <h4>增加項目</h4> <input type="text" placeholder="輸入品名..." v-model="name"/> <input type="number" placeholder="輸入價格..." v-model="price"/> <input type="button" value="add" @click="insertFn"/> </div> <hr/> <h4>列表</h4> <table border="1"> <tr> <th>編號</th> <th>品名</th> <th>價格</th> <th>刪除</th> </tr> <tr v-for="(item, index) in items"> <td>{{index+1}}</td> <td>{{item.name}}</td> <td>{{item.price | currency}}</td> <td> <input type="button" value="X" @click="delFn(index)"/> </td> </tr> </table>
</div> <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/vue/2.1.10/vue.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Vue add del - Script Codes JS Codes

var app = new Vue({	el: '#app',	data: {	name: '',	price: '',	items: [	{name: 'pen', price: '15'},	{name: 'book', price: '10'}	]	},	methods: {	insertFn: function(){	this.items.push({name: this.name, price: this.price});	this.name = '';	this.price = '';	},	delFn: function(index){	this.items.splice(index, 1)	}	}
});
Vue add del - Script Codes
Vue add del - Script Codes
Home Page Home
Developer Eric
Username ericyericy
Uploaded December 07, 2022
Rating 3
Size 2,236 Kb
Views 12,144
Do you need developer help for Vue add del?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Eric (ericyericy) Script Codes
Name
Transition-duration
CSS resume
Pen,pineapple,apple
V-on
Brand Guideline
A Pen by Eric
Vue
NameCard
Create amazing blog posts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!