Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tab 切换选中状态有问题,有时是先执行changed再切换选中颜色,有时先切换颜色再执行changed #34

Closed
autostu opened this issue Dec 24, 2017 · 0 comments

Comments

@autostu
Copy link

autostu commented Dec 24, 2017

function sleep(numberMillis) {
var now = new Date();
var exitTime = now.getTime() + numberMillis;
while (true) {
now = new Date();
if (now.getTime() > exitTime)
return;
}
}
$ui.render({
type: "view",
props: {
title: "加解密"
},
views: [{
type: "tab",
props: {
id: "tab",
items:["加密","解密"],
index: 1
},
layout: function(make, view) {
make.top.equalTo(0).offset(10)
},events: {
changed: function(sender) {
var items = sender.items
var index = sender.index
sleep(3000)
$ui.toast(index + ": " + items[index])
}
}
}]
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants