-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
68 changed files
with
560 additions
and
1,041 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>dev.md</title> | ||
</head> | ||
<body> | ||
<h1 id="-">开发方式</h1> | ||
<h3 id="-">一、单页开发</h3> | ||
<p><a href="https://www.easybui.com/p/download.html">下载单页开发包</a></p> | ||
<ul> | ||
<li>优点:体验好,媲美app,操控强,按需加载或一次性加载;</li> | ||
<li>缺点:不支持后端语言输出展示,不支持seo;</li> | ||
</ul> | ||
<p>!> 单页开发预览需要IIS部署,或者node工程的支持,默认需要3个文件。</p> | ||
<p><em>index.html</em></p> | ||
<pre><code class="lang-html"><!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> | ||
<title>BUI</title> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/buijs@latest/lib/latest/bui.css" /> | ||
</head> | ||
<body> | ||
<div id="bui-router"></div> | ||
|
||
<!-- content --> | ||
<script src="https://cdn.jsdelivr.net/npm/buijs@latest/lib/zepto.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/buijs@latest/lib/latest/bui.js"></script> | ||
<script> | ||
// router init | ||
window.router = bui.router(); | ||
|
||
bui.ready(function(global){ | ||
// router init, will find default page. pages/main/main.html pages/main/main.js | ||
router.init({ | ||
id: "#bui-router" | ||
}) | ||
}) | ||
</script> | ||
</body> | ||
</html> | ||
</code></pre> | ||
<p><em>pages/main/main.html</em></p> | ||
<pre><code class="lang-html"><!-- BUI标准结构 --> | ||
<div class="bui-page bui-box-vertical"> | ||
<header> | ||
<!-- 顶部固定内容 --> | ||
<div class="bui-bar"> | ||
<div class="bui-bar-left"> | ||
<div class="bui-btn"><i class="icon-back"></i></div> | ||
</div> | ||
<div class="bui-bar-main">BUI首页</div> | ||
<div class="bui-bar-right"></div> | ||
</div> | ||
</header> | ||
<main> | ||
<!-- 中间滚动内容 --> | ||
<div class="bui-btn warning">中间按钮</div> | ||
</main> | ||
<footer> | ||
<!-- 底部固定内容 --> | ||
<div class="bui-btn primary">底部按钮</div> | ||
</footer> | ||
</div> | ||
</code></pre> | ||
<p><em>pages/main/main.js</em> 特定的模块包装</p> | ||
<pre><code class="lang-js">loader.define(function(requires,exports,module,global){ | ||
// requires: 加载模块 | ||
// module: 模块信息 | ||
// global: 获取全局方法 | ||
bui.alert("done"); | ||
|
||
}) | ||
</code></pre> | ||
<h3 id="-">二、多页开发</h3> | ||
<p><a href="http://easybui.com/downloads/source/bui/bui_router_dev_latest.zip">下载多页开发包</a></p> | ||
<ul> | ||
<li>优点:简单,支持后端语言输出展示,支持seo;</li> | ||
<li>缺点:体验较差,无法定制交互及路由操作;</li> | ||
</ul> | ||
<p><em>index.html</em></p> | ||
<pre><code class="lang-html"> | ||
<!DOCTYPE HTML> | ||
<html> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> | ||
<title>BUI</title> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/buijs@latest/lib/latest/bui.css" /> | ||
</head> | ||
<body> | ||
<!-- BUI标准结构 --> | ||
<div class="bui-page bui-box-vertical"> | ||
<header> | ||
<!-- 顶部固定内容 --> | ||
<div class="bui-bar"> | ||
<div class="bui-bar-left"> | ||
<div class="bui-btn"><i class="icon-back"></i></div> | ||
</div> | ||
<div class="bui-bar-main">BUI首页</div> | ||
<div class="bui-bar-right"></div> | ||
</div> | ||
</header> | ||
<main> | ||
<!-- 中间滚动内容 --> | ||
<div class="bui-btn warning">中间按钮</div> | ||
</main> | ||
<footer> | ||
<!-- 底部固定内容 --> | ||
<div class="bui-btn primary">底部按钮</div> | ||
</footer> | ||
</div> | ||
|
||
<script src="https://cdn.jsdelivr.net/npm/buijs@latest/lib/zepto.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/buijs@latest/lib/latest/bui.js"></script> | ||
<script> | ||
bui.ready(function(global){ | ||
// init | ||
bui.alert("done") | ||
}) | ||
</script> | ||
</body> | ||
</html> | ||
|
||
</code></pre> | ||
<p><a href="https://codesandbox.io/s/qnzgk?file=/doc-examples/createpage.html">点击在线预览</a></p> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.