<script type="module" src="./src/main.js"></script>
...
<div class="anniu">
<button onclick="decompose()">拆解</button>
</div>
// 外部js脚本 main.js
window.decompose = function (){
console.log("aaaaa")
world.setModelMeshDecompose(20);
}
<script type="module" src="./src/main.js"></script>
...
<div class="anniu">
<button onclick="decompose()">拆解</button>
</div>
// 外部js脚本 main.js
window.decompose = function (){
console.log("aaaaa")
world.setModelMeshDecompose(20);
}