我想通過使用附加到窗口對(duì)象的函數(shù)來調(diào)用構(gòu)造函數(shù)方法,但它不起作用。我的代碼:// Modal.jsexport default class Modal { constructor (...) { .... } ....}/ main.jsimport Modal from './modules/Modal.js';window.createModal = ??? // I tried new Modal / Modal / Modal.constructor but none of these work
Javascript 模塊語法調(diào)用構(gòu)造函數(shù)
人到中年有點(diǎn)甜
2023-08-05 11:54:21