Vue add del
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 - 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) } }
});
Developer | Eric |
Username | ericyericy |
Uploaded | December 07, 2022 |
Rating | 3 |
Size | 2,236 Kb |
Views | 12,144 |
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!
Name | Size |
Pen,pineapple,apple | 3,333 Kb |
NameCard | 2,801 Kb |
Vue add del | 2,236 Kb |
Transition-duration | 1,935 Kb |
CSS resume | 6,784 Kb |
V-on | 3,337 Kb |
Brand Guideline | 4,033 Kb |
A Pen by Eric | 1,212 Kb |
Vue | 4,864 Kb |
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!
Name | Username | Size |
Jochaho Skeleton | Dhanushbadge | 1,689 Kb |
Multi column experiment. | Spylefkaditis | 2,805 Kb |
Tail rose iris lined | Kbrtrm | 1,846 Kb |
Kut D3 | Jellevrswk | 3,687 Kb |
Random Gradients - JS | Aldlevine | 2,026 Kb |
Price Comparison Table | Orrinward | 3,459 Kb |
Marching Squares Visualized | Sakri | 7,074 Kb |
CSS3 Snow Animation | NickyCDK | 1,695 Kb |
A Pen by Michael Parenteau | Michaelparenteau | 2,133 Kb |
12 DAYS OF XMAS | Proto78 | 2,313 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!