<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <div id="app-6"> <div v-for="item in msg" style="border:1px solid orchid"> <div style="background:pink;padding:4px;">{{item.sex}}</div> <div style="background:skyblue;padding:4px;">{{item.aihao}}</div> </div> </div> <script type="text/javascript" src="jquery-1.9.1.min.js"></script> <script type="text/javascript" src="vue.min.js"></script> <script> //那可以在外面利用js或jquery向后台请求数据,并存储到一个变量中, // 然后通过变量赋给vue中data,然后html中则可以利用vue进行数据渲染? var msg = [ {'sex':'nan','aihao':'chi'}, {'sex':'nv','aihao':'wan'} ] var app6 = new Vue({ el: '#app-6', data:msg }); $(document).ready(function(){ }); </script> </body> </html>