This file contains 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
const whileTo = (cb) => { | |
let v = cb() | |
let interval = setInterval(() => { | |
if(cb()) { | |
clearInterval(interval) | |
} | |
} , 1000) | |
} | |
whileTo(() => { |
This file contains 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
import React, { createContext, Fragment, useContext, useEffect, useReducer, useRef, useState } from 'react'; | |
import { | |
findNodeHandle, | |
TouchableHighlight, | |
Animated, | |
Button, | |
UIManager, | |
StyleSheet, | |
Text, | |
View, |
This file contains 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. .roam-article 是根节点 | |
// 2. 找到所有的 h1, h2, h3 | |
// 3. 如果 h1, h2 , h3 有子组件, 给这些组件添加扩展功能 | |
// 4. 遍历其子组件 根据子组件的层次, 设置左边导航栏的宽度 | |
// 5. 子组件 | |
let deepest = 1; | |
function style() { | |
var css = ` |
This file contains 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
export default { | |
plugins: [ | |
[ | |
'umi-plugin-react', | |
{ | |
routes: { | |
exclude: [/exclude/] | |
}, | |
dynamicImport: { | |
webpackChunkName: true, |