mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 18:54:24 +00:00
add PullRefresh component
This commit is contained in:
@@ -176,6 +176,10 @@ module.exports = {
|
||||
"path": "/picker",
|
||||
"title": "Picker 选择器"
|
||||
},
|
||||
{
|
||||
"path": "/pull-refresh",
|
||||
"title": "PullRefresh 下拉刷新"
|
||||
},
|
||||
{
|
||||
"path": "/toast",
|
||||
"title": "Toast 轻提示"
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user