优化警告问题

This commit is contained in:
mgw
2023-11-27 21:30:45 +08:00
parent 96df8f971c
commit 4f83c5f29a
19 changed files with 58 additions and 74 deletions

View File

@@ -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);