update isStringOrNumber

This commit is contained in:
Harvey Zack committed 2023-04-18 18:25:51 +08:00
1 parent 6b6fca8b74
commit 6d81287de9
3 files changed
+5 -4

No files matched your search

+2 -1
View File
@@ -8,6 +8,7 @@ import {
getStyle,
inverseClass,
createElement,
isStringOrNumber,
} from './dom';
import validator from 'option-validator';
import { ComponentOption } from '../scheme';
@@ -141,7 +142,7 @@ export default class Component {
$value.innerText = $item.innerText;
if (option.onSelect) {
const result = await option.onSelect.call(this.art, find, $item, event);
if (typeof result === 'string' || typeof result === 'number') {
if (isStringOrNumber(result)) {
$value.innerHTML = result;
}
}