
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>测试</title> <script type="module" src="index.js"></script> </head> <body> </body> </html>
import {cruiser} from ‘./toyato.js‘;
import {discovery} from ‘./land-rover.js‘;
import {tire} from ‘./tire.js‘;
console.log(`轮胎使用厂家数量: ${tire.count}`);
import {tire} from ‘./tire.js‘;
tire.count++;
export let cruiser = {
name : ‘Land Cruiser‘
};
import {tire} from ‘./tire.js‘;
tire.count++;
export let discovery = {
name : ‘Land Rover Discovery‘
};
// 导出一个轮胎对象 export let tire = { name : ‘BRIDGESTONE‘, count : 0 };

原文:https://www.cnblogs.com/sea-breeze/p/9106241.html