新建一个xr-start组件
新建一个后缀名是.wxml的
<xr-scene id="xr-scene" bind:ready="handleReady">
<xr-assets bind:progress="handleAssetsProgress" bind:loaded="handleAssetsLoaded">
<xr-asset-load type="gltf" asset-id="gltf-just_a_girl" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/just_a_girl/index.glb" />
</xr-assets>
<xr-node>
<xr-node node-id="camera-target" position="0 0 0"></xr-node>
<xr-gltf node-id="gltf-just_a_girl" position="0 -0.5 0" rotation="0 0 0" scale="0.01 0.01 0.01" model="gltf-just_a_girl"></xr-gltf>
<xr-camera
id="camera" node-id="camera" position="0 0.4 1.6" clear-color="0.9 0.9 0.9 1"
target="camera-target"
camera-orbit-control=""
></xr-camera>
</xr-node>
<xr-node node-id="lights">
<xr-light type="ambient" color="1 1 1" intensity="0.3" />
<xr-light type="directional" rotation="180 0 0" color="1 1 1" intensity="2" />
</xr-node>
</xr-scene>
新建一个后缀名是.json的
{
"component": true,
"renderer": "xr-frame",
"usingComponents": {}
}
新建一个后缀名是.js的
Component({
behaviors: [require('../common/share-behavior').default],
properties: {
a: Number,
},
data: {
loaded: false
},
lifetimes: {},
methods: {
handleReady({detail}) {
const xrScene = this.scene = detail.value
console.log('xr-scene', xrScene)
},
handleAssetsProgress: function({detail}) {
console.log('assets progress', detail.value)
},
handleAssetsLoaded: function({detail}) {
console.log('assets loaded', detail.value)
this.setData({loaded: true})
},
handleRaf: function({detail}) {
console.log('raf', detail.value)
}
}
})
test.vue页面引入改组件
<template lang="pug">
view.test
xr-start#main-frame(
disable-scroll
:url="testSrc"
:width="renderWidth"
:height="renderHeight"
:style="{width:`${width}px`, height:`${height}px`, display: 'block'}"
)
</template>
打包后上面的width和height都没有展示在标签上,被删除
2***@qq.com
无@dcloudio\uni-mp-weixin\dist\uni.compiler.js 怎么操作
2024-08-27 17:16
BFC
回复 2***@qq.com: cli项目的话,就在根目录 node_modules找起,如果是hbuilderX项目的话,可以从hbuilder应该的目录下,从\plugins\uniapp-cli-vite\node_modles 目录找起
2024-08-27 23:15
1***@qq.com
回复 BFC: 按照这个办法解决了,感谢,请问这个bug 什么时候修复
2024-09-10 16:43
1***@qq.com (作者)
好的,谢谢
2024-09-11 11:48
1***@qq.com
回复 BFC: "应该的目录下"是什么意思
2024-09-11 16:17
BFC
回复 1***@qq.com: 不好意思,写错了, 是hbuilder应用的安装目录
2024-09-11 16:58