mirror of
https://github.com/Choices-js/Choices.git
synced 2024-06-08 08:52:19 +02:00
Set value/clear value methods - to be implemented
This commit is contained in:
parent
1a9622aaff
commit
4671d37a51
4
assets/scripts/dist/choices.min.js
vendored
4
assets/scripts/dist/choices.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -912,10 +912,25 @@ export class Choices {
|
|||
* Set value of input
|
||||
* @return
|
||||
*/
|
||||
setValue(values) {
|
||||
if(isType('Array', values)) {
|
||||
console.log(values);
|
||||
}
|
||||
setValue(args) {
|
||||
const values = [...args];
|
||||
|
||||
values.forEach((item, index) => {
|
||||
if(isType('Object', item)) {
|
||||
if(!item.value) return;
|
||||
this.addItem(item.value, item.label, item.id);
|
||||
} else if(isType('String', item)) {
|
||||
this.addItem(item);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear value of inputs
|
||||
* @return
|
||||
*/
|
||||
clearValue() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue