2017-03-17 30 views
4

我在Aurelia框架應用程序中將arame場景作爲模板導入時目前正面臨一個問題。當Web頁面導入爲HTML模板時,框架Web VR可防止從引導滾動

我試圖找到相關的stackoverflow問題的幫助,但沒有一個將點連接在一起:因爲AFrame是基於Three.js這是我能找到的最相似的問題,但它沒有被回答(https://github.com/mrdoob/three.js/issues/3091)。

我整合了AFRAME場景在我的Home.html文件中,如下所示:

<template> 
    <a-scene> 
     <a-sphere position="0 1.25 -1" radius="1.25" color="#EF2D5E"></a-sphere> 

     <a-sky color="#000000"></a-sky> 
     <a-entity position="0 0 3.8"> 
      <a-camera></a-camera> 
     </a-entity> 
    </a-scene> 
</template> 

從我home.js進口AFRAME否則場景不會呈現: import 'aframe';

現在看來,這導入覆蓋了一些引導滾動功能,但我不明白爲什麼。

注意:Google材質設計精簡版和aurelia材質插件(https://github.com/genadis/aurelia-mdl)也出現了一些意外行爲,在這種情況下,AFrame場景被縮放,但頁面滾動仍然有效。

這裏GitHub的項目爲完整的代碼:https://github.com/dnhyde/aframe-aurelia.git

回答

2

使用embedded組件刪除幀全屏和position: fixed風格。 https://aframe.io/docs/master/components/embedded.html

<style>a-scene { width: 600px; height: 300px; }></style> 

<body> 
    <!-- ... --> 
    <a-scene embedded></a-scene> 
    <!-- ... --> 
</body> 
+0

非常感謝您的回答!現在引導工作正常,但aurelia的材料設計精簡插件(https://github.com/arabsight/aurelia-mdl-plugin)仍然會導致A幀內容的可視化問題。如果你有時間並且可以提供任何線索,我更新了git上的代碼。謝謝! – dnhyde