为什么在PIXI的身上访问不到loader?
这是版本
这是打印结果
PIXI打印一下看看
<template>
<div ref="appContainer"></div>
</template>
import * as PIXI from 'pixi.js';
import { onMounted, onUnmounted, ref } from 'vue';
export default {
setup() {
let app = null;
let scene = null;
let sprite = null;
const appContainer = ref(null);
onMounted(() => {
app = new PIXI.Application({
width: 800,
height: 600,
backgroundColor: 0x1099bb
});
appContainer.value.appendChild(app.view);
scene = new PIXI.Container();
app.stage.addChild(scene);
sprite = PIXI.Sprite.from('image.png');
sprite.anchor.set(0.5);
sprite.x = app.screen.width / 2;
sprite.y = app.screen.height / 2;
scene.addChild(sprite);
});
onUnmounted(() => {
app.destroy(true);
});
return {
appContainer,
scene,
sprite
};
}
}