Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mui
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
mui
Commits
843bcf30
Commit
843bcf30
authored
Dec 16, 2014
by
hbcui1984
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update preload doc
parent
bfe0ed70
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
42 deletions
+41
-42
about/index.html
about/index.html
+4
-4
components/index.html
components/index.html
+4
-4
getting-started/index.html
getting-started/index.html
+4
-4
index.html
index.html
+4
-4
javascript/index.html
javascript/index.html
+20
-21
sitemap.xml
sitemap.xml
+5
-5
No files found.
about/index.html
View file @
843bcf30
...
...
@@ -11,8 +11,8 @@
<meta
name=
"apple-mobile-web-app-status-bar-style"
content=
"black"
>
<link
rel=
"stylesheet"
href=
"http://dcloudio.github.io/mui/dist/css/bootstrap.min.css"
>
<link
rel=
"stylesheet"
href=
"http://dcloudio.github.io/mui/dist/css/mui.min.css?v=2014-12-16
17:23:3
0 +0800"
>
<link
rel=
"stylesheet"
href=
"http://dcloudio.github.io/mui/assets/css/docs.css?v=2014-12-16
17:23:3
0 +0800"
>
<link
rel=
"stylesheet"
href=
"http://dcloudio.github.io/mui/dist/css/mui.min.css?v=2014-12-16
22:11:5
0 +0800"
>
<link
rel=
"stylesheet"
href=
"http://dcloudio.github.io/mui/assets/css/docs.css?v=2014-12-16
22:11:5
0 +0800"
>
<link
rel=
"apple-touch-icon-precomposed"
sizes=
"114x114"
href=
"http://dcloudio.github.io/mui/assets/img/apple-touch-icon-114x114.png"
>
...
...
@@ -147,8 +147,8 @@
</div>
<script
src=
"http://dcloudio.github.io/mui/dist/js/jquery-2.1.1.js"
></script>
<script
src=
"http://dcloudio.github.io/mui/dist/js/bootstrap.min.js"
></script>
<script
src=
"http://dcloudio.github.io/mui/dist/js/mui.min.js?v=2014-12-16
17:23:3
0 +0800"
></script>
<script
src=
"http://dcloudio.github.io/mui/assets/js/docs.min.js?v=2014-12-16
17:23:3
0 +0800"
></script>
<script
src=
"http://dcloudio.github.io/mui/dist/js/mui.min.js?v=2014-12-16
22:11:5
0 +0800"
></script>
<script
src=
"http://dcloudio.github.io/mui/assets/js/docs.min.js?v=2014-12-16
22:11:5
0 +0800"
></script>
<script
type=
"text/javascript"
>
var
_bdhmProtocol
=
((
"
https:
"
==
document
.
location
.
protocol
)
?
"
https://
"
:
"
http://
"
);
document
.
write
(
unescape
(
"
%3Cscript src='
"
+
_bdhmProtocol
+
"
hm.baidu.com/h.js%3Ffff299fda9ff2d5ac97d9e621f738e52' type='text/javascript'%3E%3C/script%3E
"
));
...
...
components/index.html
View file @
843bcf30
...
...
@@ -11,8 +11,8 @@
<meta
name=
"apple-mobile-web-app-status-bar-style"
content=
"black"
>
<link
rel=
"stylesheet"
href=
"http://dcloudio.github.io/mui/dist/css/bootstrap.min.css"
>
<link
rel=
"stylesheet"
href=
"http://dcloudio.github.io/mui/dist/css/mui.min.css?v=2014-12-16
17:23:3
0 +0800"
>
<link
rel=
"stylesheet"
href=
"http://dcloudio.github.io/mui/assets/css/docs.css?v=2014-12-16
17:23:3
0 +0800"
>
<link
rel=
"stylesheet"
href=
"http://dcloudio.github.io/mui/dist/css/mui.min.css?v=2014-12-16
22:11:5
0 +0800"
>
<link
rel=
"stylesheet"
href=
"http://dcloudio.github.io/mui/assets/css/docs.css?v=2014-12-16
22:11:5
0 +0800"
>
<link
rel=
"apple-touch-icon-precomposed"
sizes=
"114x114"
href=
"http://dcloudio.github.io/mui/assets/img/apple-touch-icon-114x114.png"
>
...
...
@@ -3644,8 +3644,8 @@
</div>
<script
src=
"http://dcloudio.github.io/mui/dist/js/jquery-2.1.1.js"
></script>
<script
src=
"http://dcloudio.github.io/mui/dist/js/bootstrap.min.js"
></script>
<script
src=
"http://dcloudio.github.io/mui/dist/js/mui.min.js?v=2014-12-16
17:23:3
0 +0800"
></script>
<script
src=
"http://dcloudio.github.io/mui/assets/js/docs.min.js?v=2014-12-16
17:23:3
0 +0800"
></script>
<script
src=
"http://dcloudio.github.io/mui/dist/js/mui.min.js?v=2014-12-16
22:11:5
0 +0800"
></script>
<script
src=
"http://dcloudio.github.io/mui/assets/js/docs.min.js?v=2014-12-16
22:11:5
0 +0800"
></script>
<script
type=
"text/javascript"
>
var
_bdhmProtocol
=
((
"
https:
"
==
document
.
location
.
protocol
)
?
"
https://
"
:
"
http://
"
);
document
.
write
(
unescape
(
"
%3Cscript src='
"
+
_bdhmProtocol
+
"
hm.baidu.com/h.js%3Ffff299fda9ff2d5ac97d9e621f738e52' type='text/javascript'%3E%3C/script%3E
"
));
...
...
getting-started/index.html
View file @
843bcf30
...
...
@@ -11,8 +11,8 @@
<meta
name=
"apple-mobile-web-app-status-bar-style"
content=
"black"
>
<link
rel=
"stylesheet"
href=
"http://dcloudio.github.io/mui/dist/css/bootstrap.min.css"
>
<link
rel=
"stylesheet"
href=
"http://dcloudio.github.io/mui/dist/css/mui.min.css?v=2014-12-16
17:23:3
0 +0800"
>
<link
rel=
"stylesheet"
href=
"http://dcloudio.github.io/mui/assets/css/docs.css?v=2014-12-16
17:23:3
0 +0800"
>
<link
rel=
"stylesheet"
href=
"http://dcloudio.github.io/mui/dist/css/mui.min.css?v=2014-12-16
22:11:5
0 +0800"
>
<link
rel=
"stylesheet"
href=
"http://dcloudio.github.io/mui/assets/css/docs.css?v=2014-12-16
22:11:5
0 +0800"
>
<link
rel=
"apple-touch-icon-precomposed"
sizes=
"114x114"
href=
"http://dcloudio.github.io/mui/assets/img/apple-touch-icon-114x114.png"
>
...
...
@@ -141,8 +141,8 @@
</div>
<script
src=
"http://dcloudio.github.io/mui/dist/js/jquery-2.1.1.js"
></script>
<script
src=
"http://dcloudio.github.io/mui/dist/js/bootstrap.min.js"
></script>
<script
src=
"http://dcloudio.github.io/mui/dist/js/mui.min.js?v=2014-12-16
17:23:3
0 +0800"
></script>
<script
src=
"http://dcloudio.github.io/mui/assets/js/docs.min.js?v=2014-12-16
17:23:3
0 +0800"
></script>
<script
src=
"http://dcloudio.github.io/mui/dist/js/mui.min.js?v=2014-12-16
22:11:5
0 +0800"
></script>
<script
src=
"http://dcloudio.github.io/mui/assets/js/docs.min.js?v=2014-12-16
22:11:5
0 +0800"
></script>
<script
type=
"text/javascript"
>
var
_bdhmProtocol
=
((
"
https:
"
==
document
.
location
.
protocol
)
?
"
https://
"
:
"
http://
"
);
document
.
write
(
unescape
(
"
%3Cscript src='
"
+
_bdhmProtocol
+
"
hm.baidu.com/h.js%3Ffff299fda9ff2d5ac97d9e621f738e52' type='text/javascript'%3E%3C/script%3E
"
));
...
...
index.html
View file @
843bcf30
...
...
@@ -11,8 +11,8 @@
<meta
name=
"apple-mobile-web-app-status-bar-style"
content=
"black"
>
<link
rel=
"stylesheet"
href=
"http://dcloudio.github.io/mui/dist/css/bootstrap.min.css"
>
<link
rel=
"stylesheet"
href=
"http://dcloudio.github.io/mui/dist/css/mui.min.css?v=2014-12-16
17:23:3
0 +0800"
>
<link
rel=
"stylesheet"
href=
"http://dcloudio.github.io/mui/assets/css/docs.css?v=2014-12-16
17:23:3
0 +0800"
>
<link
rel=
"stylesheet"
href=
"http://dcloudio.github.io/mui/dist/css/mui.min.css?v=2014-12-16
22:11:5
0 +0800"
>
<link
rel=
"stylesheet"
href=
"http://dcloudio.github.io/mui/assets/css/docs.css?v=2014-12-16
22:11:5
0 +0800"
>
<link
rel=
"apple-touch-icon-precomposed"
sizes=
"114x114"
href=
"http://dcloudio.github.io/mui/assets/img/apple-touch-icon-114x114.png"
>
...
...
@@ -121,8 +121,8 @@
</div>
<script
src=
"http://dcloudio.github.io/mui/dist/js/jquery-2.1.1.js"
></script>
<script
src=
"http://dcloudio.github.io/mui/dist/js/bootstrap.min.js"
></script>
<script
src=
"http://dcloudio.github.io/mui/dist/js/mui.min.js?v=2014-12-16
17:23:3
0 +0800"
></script>
<script
src=
"http://dcloudio.github.io/mui/assets/js/docs.min.js?v=2014-12-16
17:23:3
0 +0800"
></script>
<script
src=
"http://dcloudio.github.io/mui/dist/js/mui.min.js?v=2014-12-16
22:11:5
0 +0800"
></script>
<script
src=
"http://dcloudio.github.io/mui/assets/js/docs.min.js?v=2014-12-16
22:11:5
0 +0800"
></script>
<script
type=
"text/javascript"
>
var
_bdhmProtocol
=
((
"
https:
"
==
document
.
location
.
protocol
)
?
"
https://
"
:
"
http://
"
);
document
.
write
(
unescape
(
"
%3Cscript src='
"
+
_bdhmProtocol
+
"
hm.baidu.com/h.js%3Ffff299fda9ff2d5ac97d9e621f738e52' type='text/javascript'%3E%3C/script%3E
"
));
...
...
javascript/index.html
View file @
843bcf30
...
...
@@ -11,8 +11,8 @@
<meta
name=
"apple-mobile-web-app-status-bar-style"
content=
"black"
>
<link
rel=
"stylesheet"
href=
"http://dcloudio.github.io/mui/dist/css/bootstrap.min.css"
>
<link
rel=
"stylesheet"
href=
"http://dcloudio.github.io/mui/dist/css/mui.min.css?v=2014-12-16
17:23:3
0 +0800"
>
<link
rel=
"stylesheet"
href=
"http://dcloudio.github.io/mui/assets/css/docs.css?v=2014-12-16
17:23:3
0 +0800"
>
<link
rel=
"stylesheet"
href=
"http://dcloudio.github.io/mui/dist/css/mui.min.css?v=2014-12-16
22:11:5
0 +0800"
>
<link
rel=
"stylesheet"
href=
"http://dcloudio.github.io/mui/assets/css/docs.css?v=2014-12-16
22:11:5
0 +0800"
>
<link
rel=
"apple-touch-icon-precomposed"
sizes=
"114x114"
href=
"http://dcloudio.github.io/mui/assets/img/apple-touch-icon-114x114.png"
>
...
...
@@ -449,29 +449,28 @@ mui的解决思路是:单webview只承载单个页面的dom,减少dom层级
<span
class=
"p"
>
}
</span>
<span
class=
"p"
>
]
</span>
<span
class=
"p"
>
});
</span></code></pre></div>
<p
class=
"component-note touch-only"
><strong>
Note:
</strong>
若预加载的目标窗口包含子页面,也可以直接在preloadPages参数中中配置subpages,mui框架会自动预加载子页面;subpages参数参考
<a
href=
"#subpage"
>
创建子页面
</a>
。
</p>
<p
class=
"component-description"
>
该种方案使用简单、可预加载多个页面,但不会返回预加载每个页面的引用,若要获得对应webview引用,还需要通过
<code>
plus.webview.getWebviewById
</code>
方式获得;另外,因为mui.init是异步执行,执行完mui.init方法后立即获得对应webview引用,可能会失败,例如如下代码:
</p>
<div
class=
"highlight"
><pre><code
class=
"language-js"
data-lang=
"js"
><span
class=
"nx"
>
mui
</span><span
class=
"p"
>
.
</span><span
class=
"nx"
>
init
</span><span
class=
"p"
>
({
</span>
<span
class=
"nx"
>
preloadPages
</span><span
class=
"o"
>
:
</span><span
class=
"p"
>
[
</span>
<span
class=
"p"
>
{
</span>
<span
class=
"nx"
>
url
</span><span
class=
"o"
>
:
</span><span
class=
"s1"
>
'
list.html
'
</span><span
class=
"p"
>
,
</span>
<span
class=
"nx"
>
id
</span><span
class=
"o"
>
:
</span><span
class=
"s1"
>
'
list
'
</span>
<span
class=
"p"
>
}
</span>
<span
class=
"p"
>
]
</span>
<span
class=
"p"
>
});
</span>
<span
class=
"kd"
>
var
</span>
<span
class=
"nx"
>
list
</span>
<span
class=
"o"
>
=
</span>
<span
class=
"nx"
>
plus
</span><span
class=
"p"
>
.
</span><span
class=
"nx"
>
webview
</span><span
class=
"p"
>
.
</span><span
class=
"nx"
>
getWebviewByid
</span><span
class=
"p"
>
(
</span><span
class=
"s1"
>
'
list
'
</span><span
class=
"p"
>
);
</span><span
class=
"c1"
>
//这里可能返回空;
</span></code></pre></div>
<p
class=
"component-description"
>
方式二:通过mui.preload方法预加载.
</p>
<div
class=
"highlight"
><pre><code
class=
"language-js"
data-lang=
"js"
><span
class=
"nx"
>
mui
</span><span
class=
"p"
>
.
</span><span
class=
"nx"
>
preload
</span><span
class=
"p"
>
({
</span>
<div
class=
"highlight"
><pre><code
class=
"language-js"
data-lang=
"js"
><span
class=
"
kd"
>
var
</span>
<span
class=
"nx"
>
page
</span>
<span
class=
"o"
>
=
</span>
<span
class=
"
nx"
>
mui
</span><span
class=
"p"
>
.
</span><span
class=
"nx"
>
preload
</span><span
class=
"p"
>
({
</span>
<span
class=
"nx"
>
url
</span><span
class=
"o"
>
:
</span><span
class=
"k"
>
new
</span><span
class=
"o"
>
-
</span><span
class=
"nx"
>
page
</span><span
class=
"o"
>
-
</span><span
class=
"nx"
>
url
</span><span
class=
"p"
>
,
</span>
<span
class=
"nx"
>
id
</span><span
class=
"o"
>
:
</span><span
class=
"k"
>
new
</span><span
class=
"o"
>
-
</span><span
class=
"nx"
>
page
</span><span
class=
"o"
>
-
</span><span
class=
"nx"
>
id
</span><span
class=
"p"
>
,
</span><span
class=
"c1"
>
//默认使用当前页面的url作为id
</span>
<span
class=
"nx"
>
styles
</span><span
class=
"o"
>
:
</span><span
class=
"p"
>
{},
</span><span
class=
"c1"
>
//窗口参数
</span>
<span
class=
"nx"
>
extras
</span><span
class=
"o"
>
:
</span><span
class=
"p"
>
{}
</span><span
class=
"c1"
>
//自定义扩展参数
</span>
<span
class=
"p"
>
})
</span></code></pre></div>
<p
class=
"component-description"
>
示例:Hello mui首页显示后,用户点击badge(数字角标)、checkbox(复选框)、dialog(消息框)三个页面时,不会出现waiting等待框,而是立即打开了新页面;但点击icon(图标)页面时,则会先显示waiting等待框,再进入新页面;这种效果就是因为使用了预加载技术,Hello mui设置首页最多允许预加载3个页面(preloadLimit为3),然后在首页plusReady事件后,预加载了前3个一级列表页面,,故有前面所述的体验效果;实现代码如下:
</p>
<div
class=
"highlight"
><pre><code
class=
"language-js"
data-lang=
"js"
><span
class=
"nx"
>
$
</span><span
class=
"p"
>
(
</span><span
class=
"s1"
>
'
#list
>
.mui-table-view-cell
'
</span><span
class=
"p"
>
,
</span>
<span
class=
"nb"
>
document
</span><span
class=
"p"
>
.
</span><span
class=
"nx"
>
body
</span><span
class=
"p"
>
).
</span><span
class=
"nx"
>
each
</span><span
class=
"p"
>
(
</span><span
class=
"kd"
>
function
</span><span
class=
"p"
>
()
</span>
<span
class=
"p"
>
{
</span>
<span
class=
"c1"
>
//只预加载一级列表,二级列表在其展开时再预加载;
</span>
<span
class=
"k"
>
if
</span>
<span
class=
"p"
>
(
</span><span
class=
"o"
>
!
</span><span
class=
"k"
>
this
</span><span
class=
"p"
>
.
</span><span
class=
"nx"
>
classList
</span><span
class=
"p"
>
.
</span><span
class=
"nx"
>
contains
</span><span
class=
"p"
>
(
</span><span
class=
"s1"
>
'
mui-collapse
'
</span><span
class=
"p"
>
))
</span>
<span
class=
"p"
>
{
</span>
<span
class=
"kd"
>
var
</span>
<span
class=
"nx"
>
url
</span>
<span
class=
"o"
>
=
</span>
<span
class=
"k"
>
this
</span><span
class=
"p"
>
.
</span><span
class=
"nx"
>
querySelector
</span><span
class=
"p"
>
(
</span><span
class=
"s1"
>
'
a
'
</span><span
class=
"p"
>
).
</span><span
class=
"nx"
>
getAttribute
</span><span
class=
"p"
>
(
</span><span
class=
"s2"
>
"
href
"
</span><span
class=
"p"
>
);
</span>
<span
class=
"c1"
>
//预加载,默认使用url作为其id
</span>
<span
class=
"nx"
>
$
</span><span
class=
"p"
>
.
</span><span
class=
"nx"
>
preload
</span><span
class=
"p"
>
({
</span>
<span
class=
"nx"
>
url
</span><span
class=
"o"
>
:
</span>
<span
class=
"nx"
>
url
</span>
<span
class=
"p"
>
});
</span>
<span
class=
"k"
>
if
</span>
<span
class=
"p"
>
(
</span><span
class=
"o"
>
++
</span><span
class=
"nx"
>
count
</span>
<span
class=
"o"
>
>
=
</span>
<span
class=
"nx"
>
limit
</span><span
class=
"p"
>
)
</span>
<span
class=
"p"
>
{
</span>
<span
class=
"k"
>
return
</span>
<span
class=
"kc"
>
false
</span><span
class=
"p"
>
;
</span>
<span
class=
"p"
>
}
</span>
<span
class=
"p"
>
}
</span>
<span
class=
"p"
>
});
</span></code></pre></div>
<p
class=
"component-description"
>
通过
<code>
mui.preload()
</code>
方法预加载,可立即返回对应webview的引用,但一次仅能预加载一个页面;若需加载多个webview,则需多次调用
<code>
mui.preload()
</code>
方法;
</p>
<p
class=
"component-description"
>
如上两种方案,各有优劣,需根据具体业务场景灵活选择;
</p>
</article>
<!-- 下拉刷新 -->
<article
id=
"pullrefresh-down"
class=
"component mui-active"
>
...
...
@@ -796,8 +795,8 @@ mui的解决思路是:单webview只承载单个页面的dom,减少dom层级
</div>
<script
src=
"http://dcloudio.github.io/mui/dist/js/jquery-2.1.1.js"
></script>
<script
src=
"http://dcloudio.github.io/mui/dist/js/bootstrap.min.js"
></script>
<script
src=
"http://dcloudio.github.io/mui/dist/js/mui.min.js?v=2014-12-16
17:23:3
0 +0800"
></script>
<script
src=
"http://dcloudio.github.io/mui/assets/js/docs.min.js?v=2014-12-16
17:23:3
0 +0800"
></script>
<script
src=
"http://dcloudio.github.io/mui/dist/js/mui.min.js?v=2014-12-16
22:11:5
0 +0800"
></script>
<script
src=
"http://dcloudio.github.io/mui/assets/js/docs.min.js?v=2014-12-16
22:11:5
0 +0800"
></script>
<script
type=
"text/javascript"
>
var
_bdhmProtocol
=
((
"
https:
"
==
document
.
location
.
protocol
)
?
"
https://
"
:
"
http://
"
);
document
.
write
(
unescape
(
"
%3Cscript src='
"
+
_bdhmProtocol
+
"
hm.baidu.com/h.js%3Ffff299fda9ff2d5ac97d9e621f738e52' type='text/javascript'%3E%3C/script%3E
"
));
...
...
sitemap.xml
View file @
843bcf30
...
...
@@ -2,7 +2,7 @@
<urlset
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"
xmlns=
"http://www.sitemaps.org/schemas/sitemap/0.9"
>
<url>
<loc>
http://dcloudio.github.io/mui/
</loc>
<lastmod>
2014-12-16T
17:23:3
0+08:00
</lastmod>
<lastmod>
2014-12-16T
22:11:5
0+08:00
</lastmod>
<changefreq>
daily
</changefreq>
<priority>
1.0
</priority>
</url>
...
...
@@ -10,7 +10,7 @@
<url>
<loc>
http://dcloudio.github.io/mui/about/
</loc>
<lastmod>
2014-12-16T
17:23:3
0+08:00
</lastmod>
<lastmod>
2014-12-16T
22:11:5
0+08:00
</lastmod>
<changefreq>
weekly
</changefreq>
<priority>
0.7
</priority>
</url>
...
...
@@ -19,7 +19,7 @@
<url>
<loc>
http://dcloudio.github.io/mui/components/
</loc>
<lastmod>
2014-12-16T
17:23:3
0+08:00
</lastmod>
<lastmod>
2014-12-16T
22:11:5
0+08:00
</lastmod>
<changefreq>
weekly
</changefreq>
<priority>
0.7
</priority>
</url>
...
...
@@ -28,7 +28,7 @@
<url>
<loc>
http://dcloudio.github.io/mui/getting-started/
</loc>
<lastmod>
2014-12-16T
17:23:3
0+08:00
</lastmod>
<lastmod>
2014-12-16T
22:11:5
0+08:00
</lastmod>
<changefreq>
weekly
</changefreq>
<priority>
0.7
</priority>
</url>
...
...
@@ -39,7 +39,7 @@
<url>
<loc>
http://dcloudio.github.io/mui/javascript/
</loc>
<lastmod>
2014-12-16T
17:23:3
0+08:00
</lastmod>
<lastmod>
2014-12-16T
22:11:5
0+08:00
</lastmod>
<changefreq>
weekly
</changefreq>
<priority>
0.7
</priority>
</url>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment