Skip to content

Instantly share code, notes, and snippets.

Avatar

周汉成 ZhouHansen

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

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

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

Vue client example:

@ZhouHansen
ZhouHansen / .txt
Last active Feb 19, 2019
Solutions for unexpected problems from using electron
View .txt
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`