第三方库问题集合

153 阅读1分钟

The supplied DisplayObject must be a child of the caller来源Pixi

Container中如何修改元素的层级就是:container.setChildIndex(对象,index)来修改,(提供的DisplayObject必须是调用方的子对象),该对象必须已经存在于container中了。

**failed to resolve module specifier "three". relative references must start with either "/", "./", or "../".**来源Three.js

//index.html
<script async src="https://unpkg.com/es-module-shims@1.3.6/dist/es-module-shims.js"></script>
<script type="importmap">
{
    "imports": {
        "three": "https://unpkg.com/three@0.143.0/build/three.module.js"
    }
}
</script>
<script type="module" src="./text.js" ></script>
// indexx.js
import * as THREE from 'three';
.....

// 这样写入也可以
import { FontLoader } from './FontLoader.js';
import { TextGeometry } from './TextGeometry.js';

具体链接