Vue Element Autocomplete 自动补全

autocomplete(自动补全)

Vue Element Autocomplete 自动补全_第1张图片

1、testauto.vue 文件








2、user.js 文件

import request from '@/utils/request'

export function getAuto(query) {
  return request({
    url: '/v1/users/auto',
    method: 'get',
    params: query
  })
}

3、api 接口
Url: http://localhost:60548/api/v1/users/auto?page=1&per_page=10&user_name=
Method: GET
Response:

{
  "data": [
    {
      "user_code": 1,
      "user_name": "huatuo",
      "real_name": "华佗"
    },
    {
      "user_code": 2,
      "user_name": "admin888",
      "real_name": "admin666"
    },
    {
      "user_code": 3,
      "user_name": "admin777",
      "real_name": "admin666"
    }
  ],
  "code": "200",
  "msg": null
}

*
*

你可能感兴趣的:(Vue)