【发布时间】:2020-09-19 15:11:10
【问题描述】:
我有一个 vue js (vuetify) + laravel + axios 的堆栈。 我正在尝试使用 axios 填充下拉选择。 我在 laravel 上设置了一个 API 路由,所以我可以从数据库表“类别”中提取数据。 该api返回以下内容:
[
{
"id": 1,
"category_name": "Electronics",
"category_synonym": "Computer Accessories",
"created_at": "2020-05-31T20:11:56.000000Z",
"updated_at": "2020-05-31T20:11:56.000000Z"
},
{
"id": 2,
"category_name": "Hardware",
"category_synonym": "hardware",
"created_at": "2020-05-31T20:17:13.000000Z",
"updated_at": "2020-05-31T20:17:13.000000Z"
},
{
"id": 3,
"category_name": "Kitchenware",
"category_synonym": null,
"created_at": "2020-05-31T20:49:32.000000Z",
"updated_at": "2020-05-31T20:49:32.000000Z"
},
{
"id": 4,
"category_name": "Textile",
"category_synonym": null,
"created_at": "2020-05-31T21:29:30.000000Z",
"updated_at": "2020-05-31T21:29:30.000000Z"
}
]
我想将 category_name 放入一个包含在一个 foram 中的 vue js 下拉列表中。 怎么做才简单?
【问题讨论】:
标签: javascript vue.js axios