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) } },