Skip to content

Instantly share code, notes, and snippets.

View dive2Pro's full-sized avatar
:shipit:
Sticking

dive2Pro

:shipit:
Sticking
  • 中国-深圳
View GitHub Profile
@dive2Pro
dive2Pro / roam-remember-route-position.js
Created April 18, 2022 10:24
roam-remember-route-position
const whileTo = (cb) => {
let v = cb()
let interval = setInterval(() => {
if(cb()) {
clearInterval(interval)
}
} , 1000)
}
whileTo(() => {
@dive2Pro
dive2Pro / drag_drop_swipe_rn.js
Created December 1, 2021 01:16
给 flatlist 添加左滑&drag&drop 功能
import React, { createContext, Fragment, useContext, useEffect, useReducer, useRef, useState } from 'react';
import {
findNodeHandle,
TouchableHighlight,
Animated,
Button,
UIManager,
StyleSheet,
Text,
View,
@dive2Pro
dive2Pro / side-dictory.js
Created September 4, 2020 10:54
给 roam 添加边栏
// 1. .roam-article 是根节点
// 2. 找到所有的 h1, h2, h3
// 3. 如果 h1, h2 , h3 有子组件, 给这些组件添加扩展功能
// 4. 遍历其子组件 根据子组件的层次, 设置左边导航栏的宽度
// 5. 子组件
let deepest = 1;
function style() {
var css = `
export default {
plugins: [
[
'umi-plugin-react',
{
routes: {
exclude: [/exclude/]
},
dynamicImport: {
webpackChunkName: true,