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
如何用avalon让输入框自动获取焦点 #495
Comments
input.focus() |
美大,input.focus是啥意思哈?是dom操作么? |
avalon也是这样实现啊 |
avalon不处理让元素获得焦点,需要自己处理 |
1.36我增加一个配置项吧 <!DOCTYPE html>
<html>
<head>
<title>by 司徒正美</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<script src="../avalon.js"></script>
<style>
input:focus{
border: 1px solid green;
}
</style>
<script>
var model = avalon.define({
$id: "test",
text: "aaa",
change: function() {
model.text = new Date - 0
}
})
</script>
</head>
|
非常感谢美大。 |
我也需要这个功能 |
更新到1.3.6 已经可用了
|
No description provided. |
用 ms-bind 是可以实现获取 dom 并调用 dom 元素方法的:
为什么去掉了 |
1.0之前就去掉了 |
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
如果想让一个输入框获取焦点,可以像上面那样,利用label的for属性,或者使用jquery的focus,假如想在刷新页面或者切换tab页时让一个输入框自动获取焦点,如何用avalon实现?
The text was updated successfully, but these errors were encountered: