- Vue.js 2.x by Example
- Mike Street
- 209字
- 2021-07-02 20:00:25
Displaying, Looping, Searching, and Filtering Data
In Chapter 1, Getting Started with Vue.js, we covered the data, computed, and method objects within Vue and how to display static data values. In this chapter, were are going to cover:
- Displaying lists and more complex data with Vue using v-if, v-else, and v-for
- Filtering the lists using form elements
- Applying conditional CSS classes based on the data
The data we are going to be using is going to be randomly generated by the JSON generator service (http://www.json-generator.com/). This website allows us to get dummy data to practice with. The following template was used to generate the data we will be using. Copy the following into the left-hand side to generate data of the same format so the attributes match with the code examples, as follows:
[
'{{repeat(5)}}',
{
index: '{{index()}}',
guid: '{{guid()}}',
isActive: '{{bool()}}',
balance: '{{floating(1000, 4000, 2, "00.00")}}',
name: '{{firstName()}} {{surname()}}',
email: '{{email()}}',
registered: '{{date(new Date(2014, 0, 1), new Date(), "YYYY-
MM-ddThh:mm:ss")}}'
}
]
Before we get into building our simple app and displaying our users, we'll cover some more of the features of Vue and the HTML-specific attributes available in your view. These range from dynamically rendering content to looping through arrays.
- ASP.NET Core:Cloud-ready,Enterprise Web Application Development
- 程序員修煉之道:程序設計入門30講
- AWS Serverless架構:使用AWS從傳統部署方式向Serverless架構遷移
- 零基礎玩轉區塊鏈
- 從0到1:Python數據分析
- 智能手機APP UI設計與應用任務教程
- Building Dynamics CRM 2015 Dashboards with Power BI
- 超好玩的Scratch 3.5少兒編程
- Bitcoin Essentials
- INSTANT Lift Web Applications How-to
- Java EE互聯網輕量級框架整合開發:SSM+Redis+Spring微服務(上下冊)
- Cloud Development andDeployment with CloudBees
- 匯編語言程序設計
- Mastering Assembly Programming
- Jenkins 2.x Continuous Integration Cookbook(Third Edition)