当前位置:网站首页>14_ Basic list
14_ Basic list
2022-07-26 23:52:00 【ID does not exist.】
Basic list
v-for Instructions :
1. Used to display list data
2. grammar :v-for=“(item,index) in xxx” :key=“yyy”
3. Ergodic : Array 、 object 、 character string 、 Number of times
<body>
<div id="root">
<!-- Traversal array -->
<h2> Personnel list ( Traversal array )</h2>
<ul>
<li v-for="(p,index) of persons" :key="index">
{
{p.name}}-{
{p.age}}
</li>
</ul>
<!-- Traversing objects -->
<h2> Car information ( Traversing objects )</h2>
<ul>
<li v-for="(value,k) of car" :key="k">
{
{k}}-{
{value}}
</li>
</ul>
<!-- Traversal string -->
<h2> Test traversal string ( Use less )</h2>
<ul>
<li v-for="(char,index) of str" :key="index">
{
{char}}-{
{index}}
</li>
</ul>
<!-- Traverse the specified number of times -->
<h2> Test traversal specified number of times ( Use less )</h2>
<ul>
<li v-for="(number,index) of 5" :key="index">
{
{index}}-{
{number}}
</li>
</ul>
</div>
<script type="text/javascript">
Vue.config.productionTip = false
new Vue({
el: '#root',
data: {
persons: [{
id: '001',
name: ' Zhang San ',
age: 18
},
{
id: '002',
name: ' Li Si ',
age: 19
},
{
id: '003',
name: ' Wang Wu ',
age: 20
}
],
car: {
name: ' audi A8',
price: '70 ten thousand ',
color: ' black '
},
str: 'hello'
}
})
</script>
边栏推荐
- 【面试:并发篇26:多线程:两阶段终止模式】volatile版本
- NFT display guide: how to display your NFT collection
- Vit:vision transformer super detailed with code
- [step by step, even thousands of miles] key words in the specified time period of the statistical log
- Baidu website Collection
- [interview: concurrent Article 27: multithreading: hesitation mode]
- Galaxy securities online account opening commission, is online account opening safe for customer managers
- How to use data pipeline to realize test modernization
- An online accident, I suddenly realized the essence of asynchrony
- 第二部分—C语言提高篇_5. 位运算
猜你喜欢

push to origin/master was rejected 错误解决方法
![[shader realizes swaying effect _shader effect Chapter 4]](/img/ab/bdbc4a0f297541b532af81a49e2633.png)
[shader realizes swaying effect _shader effect Chapter 4]

Pyqt5 how to set pushbutton click event to obtain file address

Dynamic SQL

How to transfer the GPX data collected by CTI RTK out of KML and SHP with attributes for subsequent management and analysis

Three person management of system design

An online accident, I suddenly realized the essence of asynchrony

Paging plug-in -- PageHelper

The place where the dream begins ---- first knowing C language (2)

Part II - C language improvement_ 9. Linked list
随机推荐
Part II - C language improvement_ 8. File operation
Custom type
第二部分—C语言提高篇_9. 链表
My SQL is OK. Why is it still so slow? MySQL locking rules
NFT展示指南:如何展示你的NFT藏品
股票开户佣金是否可以调整?手机上开户安不安全
08 design of intelligent agricultural environmental monitoring system based on ZigBee
[H5 bottom scrolling paging loading]
Azure Synapse Analytics 性能优化指南(3)——使用具体化视图优化性能(下)
MySQL random paging to get non duplicate data
Bid farewell to wide tables and achieve a new generation of Bi with DQL
[step by step, even thousands of miles] key words in the specified time period of the statistical log
Part II - C language improvement_ 11. Pretreatment
力扣155题,最小栈
Thousands of tiles' tilt model browsing speeds up, saying goodbye to the embarrassment of jumping out one by one
At 12:00 on July 17, 2022, the departure of love life on June 28 was basically completed, and it needs to rebound
Dynamic SQL
会议OA之我的会议
[Luogu] p1395 meeting
Application of workflow engine in vivo marketing automation | engine 03