<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>My first BIMFACE app</title>
<style type="text/css">
* {
margin: 0;
padding: 0;
}
html, body {
height: 100%;
}
#domId {
height: 100%;
}
</style>
<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="js/vue.js" type="text/javascript" charset="utf-8"></script>
</head>
</head>
<body>
<div id="domId">
</div>
<script src="https://static.bimface.com/api/BimfaceSDKLoader/BimfaceSDKLoader@latest-release.js"></script>
<script>
var vm = new Vue({
el:'#domId',
data:{
viewToken: '7ee7273827b4439ca807b5cd0386ade3',
loaderConfig:null
},
mounted:function(){
var that=this;
var options = new BimfaceSDKLoaderConfig();
options.viewToken = that.viewToken;
BimfaceSDKLoader.load( options, that.successCallback,that.failureCallback);
},
methods:{
successCallback:function(viewMetaData) {
// 创建WebApplication,直接显示模型或图纸
var dom4Show = document.getElementById('domId');
new Glodon.Bimface.Application.WebApplicationDemo(viewMetaData, dom4Show);
},
failureCallback:function(error) {
console.log(error);
}
}
})
</script>
</body>
</html>
效果图
目录结构