Vue.js a标记不适用于框架

Vue.js a标记不适用于框架,vue.js,augmented-reality,aframe,ar.js,Vue.js,Augmented Reality,Aframe,Ar.js,我安装了(npm)aframe和ar.js库;但是,当我尝试使用 有人能告诉我我做错了什么吗 <template> <v-layout> AR <v-flex height="100%"> <a-scene embedded> <a-sky color="#000"></a-sky> <a-entity camera look-controls wasd-cont

我安装了(npm)aframe和ar.js库;但是,当我尝试使用

有人能告诉我我做错了什么吗

<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”

只导入A-Frame,而不导入定义了
的ar.js

在您链接的示例中,这是通过

<script src="https://jeromeetienne.github.io/AR.js/aframe/build/aframe-ar.js"></script>

在Vue项目的src/index.js文件中添加Vue.config.ignoredElements属性和自定义元素。此文件是具有Vue实例化的文件:

Vue.config.ignoredElements = [
    'a-scene',
    'a-entity',
    'a-camera',
    'a-box',
    'a-sky',
    'a-assets',
    'a-marker',
    'a-marker-camera'
]

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
Vue.config.ignoredElements=[
“a-scene”,
“a实体”,
“a-camera”,
“a-box”,
“a-sky”,
“a资产”,
“a-marker”,
“a-marker-camera”
]
/*eslint禁用无新*/
新Vue({
el:“#应用程序”,
路由器,
组件:{App},
模板:“”
})

我理解这一点,但我希望以导入aframe的方式导入它(就像导入“aframe”)。当我导入'aframe.js'时,它不工作!您也有解决方案吗?要导入的文件是
aframe-ar.js
,而不是
aframe.js
。下面是一个GitHub存储库,其中有一个示例(查找
src/App.vue
,行
import firebase from./firebase'
与您需要的类似):
Vue.config.ignoredElements = [
    'a-scene',
    'a-entity',
    'a-camera',
    'a-box',
    'a-sky',
    'a-assets',
    'a-marker',
    'a-marker-camera'
]

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})