From b7fe5a6a7be489b6756582888d73141c8a3f5144 Mon Sep 17 00:00:00 2001 From: Kevin Levron Date: Wed, 27 Oct 2021 21:25:23 +0200 Subject: [PATCH] created event for materials #93 --- src/materials/Material.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/materials/Material.ts b/src/materials/Material.ts index ae2c355..32e72ae 100644 --- a/src/materials/Material.ts +++ b/src/materials/Material.ts @@ -19,6 +19,7 @@ export interface MaterialPublicInterface extends ComponentPublicInstance, Materi export const MaterialInjectionKey: InjectionKey = Symbol('Material') const BaseMaterial = defineComponent({ + emits: ['created'], props: { color: { type: String, default: '#ffffff' }, props: { type: Object as PropType, default: () => ({}) }, @@ -45,6 +46,7 @@ const BaseMaterial = defineComponent({ // @ts-ignore watch(() => this.color, (value) => { material.color.set(value) }) bindObjectProp(this, 'props', material, false, this.setProp) + this.$emit('created', material) this.mesh.setMaterial(material) } },