优化警告问题
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { registry } from "@web/core/registry";
|
||||
import { CharField } from '@web/views/fields/char/char_field';
|
||||
|
||||
|
||||
import {registry} from "@web/core/registry";
|
||||
import {CharField} from '@web/views/fields/char/char_field';
|
||||
|
||||
// 继承CharField组件实现自定义组件:当光标聚焦于输入框时,选中输入框内容
|
||||
class CustomChar extends CharField {
|
||||
@@ -20,7 +18,7 @@ class CustomChar extends CharField {
|
||||
// 当光标聚焦于输入框时,选中输入框内容
|
||||
this.input.el.addEventListener('focus', function () {
|
||||
this.select();
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -72,13 +70,13 @@ class CustomChar extends CharField {
|
||||
// }
|
||||
// }
|
||||
|
||||
// this.$input.on('focus', function () {
|
||||
// $(this).select();
|
||||
// });
|
||||
// this.$input.on('focus', function () {
|
||||
// $(this).select();
|
||||
// });
|
||||
|
||||
|
||||
// 当光标聚焦于输入框时,选中输入框内容
|
||||
|
||||
}
|
||||
|
||||
registry.category("fields").add("custom_char", CustomChar);
|
||||
registry.category("fields").add("custom_char", CustomChar);
|
||||
|
||||
Reference in New Issue
Block a user