add PullRefresh component

This commit is contained in:
陈嘉涵
2017-09-07 11:10:12 +08:00
parent 527e12768b
commit 9eb825f54d
9 changed files with 476 additions and 11 deletions

View File

@@ -176,6 +176,10 @@ module.exports = {
"path": "/picker",
"title": "Picker 选择器"
},
{
"path": "/pull-refresh",
"title": "PullRefresh 下拉刷新"
},
{
"path": "/toast",
"title": "Toast 轻提示"

View File

@@ -23,18 +23,19 @@ window.changePath = function(path) {
function iframeReady(iframe, callback) {
const doc = iframe.contentDocument || iframe.contentWindow.document;
const interval = () => {
if (iframe.contentWindow.changePath) {
callback();
} else {
setTimeout(() => {
interval();
}, 50);
}
};
if (doc.readyState === 'complete') {
callback();
interval();
} else {
const interval = () => {
if (iframe.contentWindow.changePath) {
callback();
} else {
setTimeout(() => {
interval();
}, 50);
}
};
iframe.onload = interval;
}
}