mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 10:44:59 +00:00
[Improvement] optimize utils (#661)
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { create } from '../utils';
|
||||
import { create, isObj } from '../utils';
|
||||
|
||||
const DEFAULT_DURATION = 200;
|
||||
const range = (num, arr) => Math.min(Math.max(num, arr[0]), arr[1]);
|
||||
@@ -147,11 +147,11 @@ export default create({
|
||||
},
|
||||
|
||||
isDisabled(option) {
|
||||
return typeof option === 'object' && option.disabled;
|
||||
return isObj(option) && option.disabled;
|
||||
},
|
||||
|
||||
getOptionText(option) {
|
||||
return typeof option === 'object' && this.valueKey in option ? option[this.valueKey] : option;
|
||||
return isObj(option) && this.valueKey in option ? option[this.valueKey] : option;
|
||||
},
|
||||
|
||||
setIndex(index, userAction) {
|
||||
|
Reference in New Issue
Block a user