I am facing some challenges trying to integrate Aframe and vuejs seamlessly, as the console is displaying warning messages. It seems like Aframe is validating the attribute values before vue has a chance to modify them.
Warning messages
core:schema:warn Unknown property `color` for component/system `undefined`. +349ms 2aframe.js:327
core:schema:warn Unknown property `color` for component/system `undefined`. +2ms aframe.js:327
core:schema:warn Unknown property `color` for component/system `undefined`. +1ms aframe.js:327
core:schema:warn Unknown property `height` for component/system `undefined`. +1ms aframe.js:327
core:schema:warn Unknown property `color` for component/system `undefined`. +1s aframe.js:327
Below is the code snippet:
App.vue
<template>
<a-scene>
<test-component v-for="block in blocks" :color="block.color" :position="block.pos"></test-component>
<a-box :color="color" height="4"></a-box>
<a-entity position="0 0 10" camera look-controls></a-entity>
</a-scene>
</template>
<script>
import TestComponent from './TestComponent.vue';
require('aframe');
export default {
name: 'app',
components:{
TestComponent,
},
data(){
return {
color: 'green',
blocks: [
{color: 'red', pos: "1 0 0"},
{color: 'orange', pos: "2 0 0"},
{color: 'yellow', pos: "3 0 0"}
]
}
},
mounted(){
//test to see if a-frame updates properly
let that = this;
setTimeout(function(){
that.blocks.push({color: 'lime', pos: "4 0 0"})
}, 1000)
setTimeout(function(){
that.blocks[3].pos = "5 0 0"
}, 2000)
}
}
</script>
TestComponent.vue
<template lang="html">
<a-box :color="color" :position="position"></a-box>
</template>
<script>
export default {
props: ['color','position'],
}
</script>
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>aframetest</title>
</head>
<body>
<div id="app"></div>
<script src="dist/build.js"></script>
</body>
</html>
main.js
import Vue from 'vue'
import App from './App.vue'
new Vue({
el: '#app',
render: h => h(App)
})