先引用
import * as Three from '../../node_modules/three/build/three.module.js';
import * as THREE from "three";
在data中添加一下数据
posx:require('../assets/sky/posx.jpg'),
negx:require('../assets/sky/negx.jpg'),
posy:require('../assets/sky/posy.jpg'),
negy:require('../assets/sky/negy.jpg'),
posz:require('../assets/sky/posz.jpg'),
negz:require('../assets/sky/negz.jpg'),
最后添加一个函数,去修改场景的背景
tian(){
//添加天空盒子
var that = this
that.scene.background = new Three.CubeTextureLoader()
.load( [ that.posx, that.negx, that.posy, that.negy, that.posz, that.negz ] );//添加天空盒子背景图
},