Vue使用搭建3d模型
1.下载依赖
npm install vue-3d-model
/
yarn add vue-3d-model
/
<script src="https://unpkg.com/vue-3d-model/dist/vue-3d-model.umd.js"></script>
官方项目地址 地址链接
演示demo地址 地址链接
其余问题正在研究
轮训
const state = reactive({
pollingST: null,
})
//初始化调用
onMounted(() => {
getData();
polling();
});
//轮训
onActivated(() => {
polling();
});
onBeforeUnmount(() => {
clearTimeout(state.pollingST);
});
onDeactivated(() => {
clearTimeout(state.pollingST);
});
const polling = () => {
getData();
state.pollingST = setTimeout(() => {
clearTimeout(state.pollingST);
polling();
}, 3000); //3s
};