|
<template>
<scroll-view class="main" scroll-y>
<input placeholder="输入限制为10,自动获取焦点" maxlength="10" autofocus/>
<input type="password" placeholder="密码输入框"/>
<input id="test" placeholder="数字键盘" keyboard-type="number"/>
<input placeholder="键盘完成按钮文字为搜索" confirm-type="search" onconfirm={this.onconfirm}/>
<view onclick='fnname'>
<text>切换焦点</text>
</view>
</scroll-view>
</template>
<style>
.main {
width: 100%;
height: 100%;
}
input {
margin: 8px;
width: auto;
}
</style>
<script>
export default {
name: 'test',
methods:{
onconfirm(e){
api.alert({
msg: '搜索' + e.detail.value
});
},
fnname() {
document.getElementById('test').focus()
}
}
}
</script> |
|