Skip to content

Instantly share code, notes, and snippets.

View ZhouHansen's full-sized avatar

周汉成 ZhouHansen

  • Anhui, China 中国安徽
View GitHub Profile
@ZhouHansen
ZhouHansen / .js
Last active August 15, 2019 04:15
省市区级联文件格式
// 现在要实现一个级联选择省市区的功能,需要提供下面的数据。
[
{
value: '浙江',
label: '浙江',
searchId: 300000, // json中应包含搜索条件,根据后端的具体实现,返回
children: [
{
value: '杭州',
@ZhouHansen
ZhouHansen / .md
Last active April 18, 2019 06:52
Using swagger with vue, django and ngnix

Swagger自动化了与api有关的工作,大致流程是这样:

  1. 从后端代码生成schema
  2. 在后端通过schema生成api文档( 1,2其实是一步)
  3. 在前端请求schema,生成http的请求代码,无须再手写

Vue client example:

@ZhouHansen
ZhouHansen / .txt
Last active February 19, 2019 07:26
Solutions for unexpected problems from using electron
If you are in china:
❌ `npm install electron`
❌ `npm run build`
✅ `ELECTRON_MIRROR=http://npm.taobao.org/mirrors/electron/ npm install electron`
✅ `ELECTRON_MIRROR=http://npm.taobao.org/mirrors/electron/ npm run build`
For windows command line:(no space between two command)
✅ `set ELECTRON_MIRROR=http://npm.taobao.org/mirrors/electron/&&npm run build`