📜  js 导入解构 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:26.932000             🧑  作者: Mango

代码示例1
// react-router.js
export const Link = 42;
export default {
  Link: 21,
};


// something.js
import {Link} from './react-router';
import Router from './react-router';
const {Link: Link2} = Router;

console.log(Link); // 42
console.log(Link2); // 21