Skip to content

Commit

Permalink
created event for materials #93
Browse files Browse the repository at this point in the history
  • Loading branch information
klevron committed Oct 27, 2021
1 parent 72b56d1 commit b7fe5a6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/materials/Material.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export interface MaterialPublicInterface extends ComponentPublicInstance, Materi
export const MaterialInjectionKey: InjectionKey<MaterialPublicInterface> = Symbol('Material')

const BaseMaterial = defineComponent({
emits: ['created'],
props: {
color: { type: String, default: '#ffffff' },
props: { type: Object as PropType<MaterialPropsInterface>, default: () => ({}) },
Expand All @@ -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)
}
},
Expand Down

0 comments on commit b7fe5a6

Please sign in to comment.