openks / learn-vue

自定义组件文档
https://openks.github.io/learn-vue
0 stars 0 forks source link

ATOM正则替换技巧 #43

Open openks opened 7 years ago

openks commented 7 years ago
import Hello from '@/components/Hello';
import Field from '@/components/page/Field';
替换为 
const Hello = () => import('@/components/Hello');
const Field = () => import('@/components/demo/Field');

有许多上面的情况要替换为下面的这种 如果一个一个替换那就太麻烦了 还好支持正则替换(需要开启正则) image

import (\w+) from '(.*)';
const $1 = () => import('$2');