刚接触vue,现在有一个需求需要将一个表的其中一项根据ID=1单独输出,之前都是遍历实现,想单独输出一项突然就迷茫了.
这是我的测试代码
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<title>JSON????</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Access-Control-Allow-Origin" content="*">
<script src="vue.js"></script>
<script src="jquery-3.3.1.js"></script>
</head>
<body>
<div id="main">
<table border=1>
<tr>
<td>id</td>
</tr>
<tr >
<td>{{rows}}</td>
</tr>
</table>
</div>
</body>
<script>
$(document).ready(function () {
$.getJSON("http://localhost/tools/VMPlatform/BackEnd/web/index.php?r=project/projects", function (result, status) {
var v = new Vue({
el: '#main',
data: {
rows: result
}
})
});
});
</script>
</html>