标签: ecmascript-6
在def.js中:
export const defs = { name: 'Joe', age: 30, id: 123 }
在user.js中:
import { defs } from './def'; const { name } = defs; console.log(name);
有没有办法立即导入defs.name,而不先导入defs? 类似的东西:
import {defs.name} from './defs';