<form>
<table>
<div id="divhenshua">
<Select v-model="vvmodel" disabled style="width:200px">
<Option v-for="item in listhenshua" :value="item.henshuaDescription" :key="item.henshuaName">{{ item.henshuaDescription }}</Option>
</Select>
</div>
</table>
</form>
<script>
$(function () {
$.get("/henshua.sp?method=queryhenshuaList", function (res) {
console.log("henshua", res);
vhenshua.listhenshua = res.rows;
});
});
var vhenshua = new Vue({
el: "#divhenshua",
data: {
listhenshua: [],
vvmodel:''
}
});
</script>
</body>
已经引入vue,看network有东西,json也能获取到,没有报错..
返回的样式是
{
"total": 1,
"rows": [
{
"henshuaName": "2",
"henshuaDescription": "bbbk",
}
]
}
- 我试过前端console有数据输出,能get到数据
- 写法无报错..
- 请各位大神指点我这个菜鸟
- 谢谢你的耐心解答
data必须为函数,结案