mirror of
https://github.com/troisjs/trois.git
synced 2024-11-24 04:12:02 +08:00
clear callbacks onUnmounted
This commit is contained in:
parent
7e0c4d5737
commit
41dfd4465a
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "troisjs",
|
"name": "troisjs",
|
||||||
"version": "0.2.1",
|
"version": "0.2.2",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
@ -11,6 +11,7 @@
|
|||||||
"@rollup/plugin-replace": "^2.3.3",
|
"@rollup/plugin-replace": "^2.3.3",
|
||||||
"@vitejs/plugin-vue": "^1.2.1",
|
"@vitejs/plugin-vue": "^1.2.1",
|
||||||
"@vue/compiler-sfc": "^3.0.11",
|
"@vue/compiler-sfc": "^3.0.11",
|
||||||
|
"cannon": "^0.6.2",
|
||||||
"eslint": "^7.7.0",
|
"eslint": "^7.7.0",
|
||||||
"eslint-config-airbnb-base": "^14.2.0",
|
"eslint-config-airbnb-base": "^14.2.0",
|
||||||
"eslint-config-standard": "^14.1.1",
|
"eslint-config-standard": "^14.1.1",
|
||||||
|
@ -28,6 +28,7 @@ export default function useCannon(options) {
|
|||||||
removeMesh,
|
removeMesh,
|
||||||
step,
|
step,
|
||||||
};
|
};
|
||||||
|
return obj;
|
||||||
|
|
||||||
function addMesh(mesh) {
|
function addMesh(mesh) {
|
||||||
const shape = getShape(mesh.geometry);
|
const shape = getShape(mesh.geometry);
|
||||||
@ -189,6 +190,4 @@ export default function useCannon(options) {
|
|||||||
iMatrix[index + 14] = position.z;
|
iMatrix[index + 14] = position.z;
|
||||||
iMatrix[index + 15] = 1;
|
iMatrix[index + 15] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return obj;
|
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,8 @@ export default defineComponent({
|
|||||||
this.onMountedCallbacks.forEach(c => c());
|
this.onMountedCallbacks.forEach(c => c());
|
||||||
},
|
},
|
||||||
beforeUnmount() {
|
beforeUnmount() {
|
||||||
|
this.beforeRenderCallbacks = [];
|
||||||
|
this.afterRenderCallbacks = [];
|
||||||
this.raf = false;
|
this.raf = false;
|
||||||
this.three.dispose();
|
this.three.dispose();
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user