This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 1: 动态获取 baseUrl | |
| let baseURL; | |
| if (window.location.host.startsWith('localhost')) { | |
| baseURL = 'https://dev.utcook.com'; | |
| } else { | |
| baseURL = window.location.origin; | |
| } | |
| // 2: axios 实例、请求拦截、响应拦截 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 快速排序算法 | |
| var quickSort = function(arr) { | |
| if(arr.length <= 1) { | |
| return arr; | |
| } | |
| var pivotIndex = Math.floor(arr.length / 2); | |
| var pivot = arr.splice(pivotIndex, 1)[0]; | |
| var left = []; | |
| var right = []; | |
| for(var i = 0; i < arr.length; i++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 属性代理, 抽离 state, 组件 ref | |
| // 链接: https://juejin.im/post/5c72b97de51d4545c66f75d5 | |
| import React, { Component } from 'react'; | |
| import { Input, message } from 'antd'; | |
| function withOnChange(WrappedComponent) { | |
| return class extends Component { | |
| sonRef = {}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>CSS3自定义滚动条-轩枫阁</title> | |
| <style> | |
| header | |
| { | |
| font-family: 'Lobster', cursive; | |
| text-align: center; |