VUEJS7-V-FOR Directive 2

Source: Internet
Author: User

<! DOCTYPE html>

<meta charset= "Utf-8" >

<meta http-equiv= "x-ua-compatible" content= "Ie=edge" >

<title></title>

<style>

* {

margin:0;

padding:0;

Box-sizing:border-box

}


HTML {

font-size:12px;

Font-family:ubuntu, Simhei, Sans-serif;

font-weight:400

}


Body {

Font-size:1rem

}


Table

Td

th {

Border-collapse:collapse;

border-spacing:0

}


Table {

width:100%

}


Td

th {

border:1px solid #bcbcbc;

padding:5px 10px

}


th {

Background: #42b983;

Font-size:1.2rem;

font-weight:400;

Color: #fff;

Cursor:pointer

}


Tr:nth-of-type (Odd) {

Background: #fff

}


Tr:nth-of-type (even) {

Background: #eee

}


fieldset {

border:1px solid #BCBCBC;

padding:15px;

}


#app {

margin:0 Auto;

max-width:640px

}

</style>

<body>

<div id= "App" >

<table>

<thead>

<tr>

<th>Name</th>

<th>Age</th>

<th>Sex</th>

</tr>

</thead>

<tbody>

<TR v-for= "person in people" >

<td>{{Person.name}}</td>

<td>{{Person.age}}</td>

<td>{{Person.sex}}</td>

</tr>

</tbody>

</table>

</div>

<script src= "Http://static.runoob.com/assets/vue/1.0.11/vue.min.js" ></script>

<script>

var vm = new Vue ({

El: "#app",

data:{

People: [{

Name: ' Jack ',

Age:30,

Sex: ' Male '

}, {

Name: ' Bill ',

Age:26,

Sex: ' Male '

}, {

Name: ' Tracy ',

Age:22,

Sex: ' Female '

}, {

Name: ' Chris ',

AGE:36,

Sex: ' Male '

}]

}

});

</script>

</body>


This article is from the "Yan" blog, please be sure to keep this source http://suyanzhu.blog.51cto.com/8050189/1895501

VUEJS7-V-FOR Directive 2

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.