mirror of
https://gitee.com/tengzhinei/Vue-rap.git
synced 2025-12-24 08:12:44 +08:00
75 lines
2.2 KiB
HTML
75 lines
2.2 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, minimum-scale=1.0">
|
|
<meta http-Equiv="Cache-Control" Content="no-cache"/>
|
|
<meta http-Equiv="Pragma" Content="no-cache"/>
|
|
<meta http-Equiv="Expires" Content="0"/>
|
|
<!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
|
|
</head>
|
|
<style>
|
|
[v-cloak] {
|
|
display: none;
|
|
}
|
|
</style>
|
|
<body>
|
|
|
|
<div id="app" v-cloak>
|
|
<nav class="navbar navbar-default">
|
|
<div class="container-fluid">
|
|
<div class="navbar-header">
|
|
<a class="navbar-brand" href="#">Vue-rap单页面实例</a>
|
|
<button style="margin-top: 7px;" v-link.back class="btn btn-default">后退</button>
|
|
</div>
|
|
</div><!-- /.container-fluid -->
|
|
</nav>
|
|
<!--childView是固定值-->
|
|
<component v-bind:is="childView">
|
|
</component>
|
|
</div>
|
|
</body>
|
|
<!--引用 vue-rap文件-->
|
|
<script src="../rap.1.3.0.js"></script>
|
|
|
|
<style>
|
|
:root {
|
|
--bgColor: #000;
|
|
}
|
|
</style>
|
|
<script>
|
|
//代码写在onload里防止阻塞页面渲染
|
|
window.onload = function () {
|
|
Rap.config({
|
|
debug: false,
|
|
default_page: "test/default",
|
|
app_version: '14',
|
|
comp_version: {'test_page6': 1},
|
|
css: [
|
|
'bootstrap.3.3.7.min.css'
|
|
],
|
|
filePostfix:'html',//默认后缀为 html
|
|
script: [
|
|
"vue.2.5.13.js",
|
|
"vue-role.0.1.0.js"
|
|
],onPageLoadError:function (page,e) {
|
|
//页面加载错误
|
|
console.log('page'+page+e);
|
|
}
|
|
}).ready(function () {
|
|
if (!Rap.debug) {
|
|
//这里可以异步加载编译后的文件
|
|
// return Rap.loadScript('rap-all.js'); //loadScript 返回的也是promise
|
|
}
|
|
}).then(function () {
|
|
//这里也可以预加载模块
|
|
return Rap.loadMod(['test/page3']); //loadMod 返回的也是promise
|
|
}).then(function () {
|
|
window.APP = Rap.app({
|
|
el: '#app'
|
|
});
|
|
});
|
|
}
|
|
</script>
|
|
|
|
</html> |