1Vue & Element ̨Ĺص

1Web API˵ļܹ

ǰˡȫļܹƣ˲ûAsp.netWeb APIṩAPIķ࣬Web API¼ܹʾ

ͨļܹƣԿײBLLDALEntityIDALȷֲ㶼ȫͨõģͬǣǺֻṩWeb APIĽӿڷǰˣǵġABPʹáһ£ǰ˷롣 Ϊ˸õĽкWeb APIطķװǰһЩĽӿڴBaseApiController棬ѻҵIJӿڷBusinessController涨壬ʾ

BaseApiController棬ʹ˽װ쳣ĹͳһҵĽӿͨ÷װBusinessController棬ʹ˷Ͷ壬ʵ࣬ҵ࣬ҳΪԼ,ͨWeb APIӿڷؽͳһװǶصĸʽʾ

 

 

2Vue&Elementǰ˵ļܹƣ

Vue&Elementǰ˵ļܹƣҲABPܵǰ˹֣Vue&Elementǰ˵ļܹʾ

ǰ˷Vue + Element Ϊǰ˼·ߣôǰ˵ı߽dzǰ˿ͨȡӦJSONͿԹǰ˵Ӧˡ һ˵ҳģܻ漰Storeģ飬洢Ӧ״̬ϢҲֱӷAPIģ飬ʵݵĵòչʾҳ濪У£ҪStoreģнһֻҪ洢ӦҳΪȫ״̬£ſStoreģĴͨWebProxyĴǿԺǰʵֿĴͬ·òַͬAPIԣתΪصAPIãǿĴ

ǰ˸ABP˵ĽӿڽǰJS˵ķװES6ĸʵҵӿڵͳһװ򻯴롣 Ȩģ漰ûɫ˵ܹ־¼־ҵ࣬ôЩ̳BaseApiͻصĽӿˣʾ̳йϵ

 

3WebApi+Vue&Elementǰ˽չʾ

ܽõǻں̨õIJ˵̬ɣDz˵ұ߶ضABPܵǰ˽һµġ ϵͳĿ϶DZ׼Ľ棬ϵͳϵͳ˵Ҳмбչʾݣϵͳ˵Ƚ϶ʱ򣬾ҪѲ˵Ϊϵͳ˵һԶ˵бͨб۵ͿԷ÷dzIJ˵ˡ 

û棬ϮBootstrapܵIJֽйͨûʽչʾûҳб½ʾ 

ʾ 

ɫʾ 

ɫı༭ʾ˻Ϣû˵Ȩ޵Ŀ 

ϵͳIJ˵ȿͨĬMockijʼ˵ҲͨAPIõIJ˵Դ̬ڽϽչʾϵͳIJ˵Ƕ̬ȡչʾģ·ɵжϿûʵIJ˵Ȩޡ˵ʾ 

˵ԴڽɫзɫʵֶԲ˵Ķ̬ƹˡ ǰ˵Ľɿֲͨģķʽɸӷϴ 

ģ黯Ĵʽǿ԰ѽ沿ΪһзװȨ޹УǶһõ棬ʾ 

øֽԶнImportʹüɣdzá