vue全局调用数据字典从服务端后取数据
服务端代码:
@GetMapping("/getTypeValue/{vccodetype}")
public R getTypeValue(@PathVariable("vccodetype") String vccodetype){
List<SysDictEntity> list = sysDictService.getTypeValue(vccodetype);
return R.ok().put("typeList", list);
}
前端代码:
第一步:写一个字典向外暴露的方法
2.在入口文件main.js引入:
3.在应用文件中调用,想要的数据在reponse中获取,引号中的值是需要传入的参数。参数值自行定义