1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- Page({
- data: {
- focus: false,
- inputValue: '',
- },
- bindButtonTap() {
- this.onFocus();
- },
- onFocus() {
- this.setData({
- focus: true,
- });
- },
- onBlur() {
- this.setData({
- focus: false,
- });
- },
- bindKeyInput(e) {
- this.setData({
- inputValue: e.detail.value,
- });
- },
- bindHideKeyboard(e) {
- if (e.detail.value === '123') {
- // 收起键盘
- my.hideKeyboard();
- }
- },
- handleSearch(e) {
- console.log('search', e.detail.value);
- this.setData({
- search: e.detail.value,
- });
- },
- doneSearch() {
- console.log('doneSearch', this.data.search);
- my.hideKeyboard();
- },
- clearSearch() {
- console.log('clear search', this.data.search);
- this.setData({
- search: '',
- });
- },
- });
|