vue-for

作者: 另一个童话 | 来源:发表于2018-09-11 20:32 被阅读0次

       <!DOCUMENT html>

         <html lang="en">

       <head>

        <meta charest="UTF-8">

    <title>Document</title>

     </head>

     <body>

    <div class="ids">

    <ul>

    <li v-for="v in arr">{{v}}</li>

    <li v-for=''vi in obj">{{vi}}</li>

   </ul>

   <.ul>

   <li v-for="(val,ind) in arr">

    {{ind}}-----{{val}}

   </li>

    <li v-for="(val,ind) in obj">

    {{ind}}>{{val}}

   <li>

    <li v- for="value in ars">

    {{value.num}}

    {{value.name}}

   {{value.price}}

    </li>

     </ul>

       <from action="#">

      <table border="1">

      <thead>

     <tr>

    <th>编号</th>

     <th>名称</th>

     <th>单价</th>

     </tr>

      </thead>

      <tbody>

      <tr v-for="(value,index) in ars">

     <td>{{index+1}}</td>

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

     <td>{{value.price}}</td>

     </tr>

      </tbody>

       </table>

       </from>

      </div>

         new Vue({

            el: '.ids'

            , data: {

                arr: [123, 123, 123, 123, 976926]

                , obj: {

                    name: '小明'

                    , age: 15

          }

      , ars: [{

           num: 1

           , name: "apple"

                        , price: 3

                  }

                , {

                   num: 1

                   , name: "banner"

                    , price: 1

                    }

                    , {

                 num: 1

                  , name: "orang"

                    , price: 2

                   }

              ]

            }

        })

   </script>

    </body>

    </html>

相关文章

  • vue-for

    Document {{v}} {{vi}} <.u...

  • vue-for

  • 2018-09-11

    第一节 {{val}}---{{inp}} 第二节 vue-for循环 第三节

  • Vue-for循环、循环数组

    Vue中,数组遍历和其他语言语法类似,比如有一个数组: list=['a','b','c','d']现在要遍历这个...

网友评论

      本文标题:vue-for

      本文链接:https://www.haomeiwen.com/subject/jfcpgftx.html