一、一元判断,存到Map里
1 | const actions = new Map([ |
二、多元判断,将condition拼接成字符串存到Map里
1 | const actions = new Map([ |
三、多元判断,将condition存为Object存到Map里
1 | const actions = new Map([ |
四、多元判断,将condition写作正则存到Map里
1 | const actions = ()=>{ |
参考文章:
1 | const actions = new Map([ |
1 | const actions = new Map([ |
1 | const actions = new Map([ |
1 | const actions = ()=>{ |
参考文章: