2
我安裝了(npm)aframe和ar.js庫;然而,當我嘗試使用<a-marker>
或<a-marker-camera>
,我得到以下錯誤:a-marker不適用於aframe
Unknown custom element: <a-marker-camera>
我能夠導入AFRAME庫,但是當我想導入並使用ar.js庫,我得到沒有找到ar.js的錯誤。
我跟着從AR實現示例:https://aframe.io/blog/arjs/
誰能告訴我什麼,我做錯了什麼?
<template>
<v-layout>
AR
<v-flex height="100%">
<a-scene embedded>
<a-sky color="#000"></a-sky>
<a-entity camera look-controls wasd-controls position="0 1 3" rotation="-15 0 0"></a-entity>
<a-box v-bind:color="color" opacity="0.75" visible="true"></a-box>
<a-marker-camera preset='hiro'></a-marker-camera>
</a-scene>
</v-flex>
</v-layout>
</template>
<script>
import 'aframe'
</script>
<style scoped>
</style>
我明白這個工作,但我想將其導入我進口AFRAME(所以像進口「AFRAME」)的方式。當我導入'aframe.js'時不起作用!你也有解決方案嗎? – Fenno
要導入的文件是'aframe-ar.js',而不是'aframe.js'。下面是一個帶有示例的GitHub存儲庫(查找'src/App.vue',從'.firebase'導入firebase的行類似於你需要的):https://github.com/okwme/bubblehub – oha