vue列表
作者:互联网
一、实例二:vue列表显示
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <script src="js/vue.js"></script> </head> <body> <ul> <li id="flowers">{{flowers}}</li> </ul> <script> const app = new Vue({ el:'#flowers', data:{ flowers:['向日葵','雏菊','蒲公英','月季'] } }) </script> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <script src="js/vue.js"></script> </head> <body> <ul id="flowers"> <li>{{flowers[0]}}</li> <li>{{flowers[1]}}</li> <li>{{flowers[2]}}</li> <li>{{flowers[3]}}</li> </ul> <script> const app = new Vue({ el:'#flowers', data:{ flowers:['向日葵','雏菊','蒲公英','月季'] } }) </script> </body> </html>
标签:el,vue,const,列表,Vue,new,flowers 来源: https://www.cnblogs.com/pinkowonote/p/13579834.html