mirror of
https://github.com/troisjs/trois.git
synced 2024-11-24 12:22:03 +08:00
20 lines
349 B
JavaScript
20 lines
349 B
JavaScript
import Texture from './Texture.js';
|
|
|
|
export default {
|
|
extends: Texture,
|
|
inject: ['material'],
|
|
created() {
|
|
this.material.setMap(this.texture);
|
|
},
|
|
unmounted() {
|
|
this.material.setMap(null);
|
|
},
|
|
methods: {
|
|
refreshTexture() {
|
|
this.createTexture();
|
|
this.material.setMap(this.texture);
|
|
},
|
|
},
|
|
__hmrId: 'Map',
|
|
};
|