mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-09 21:36:44 +08:00
18 lines
440 B
JavaScript
18 lines
440 B
JavaScript
export default {
|
|
data() {
|
|
return {
|
|
options: this.field.attributes.data.options?.join('\n')
|
|
};
|
|
},
|
|
watch: {
|
|
options() {
|
|
const newOptions = this.options.split('\n')
|
|
.filter((option) => option.trim() !== '')
|
|
.map((option) => option.trim());
|
|
// remove duplicates
|
|
const uniqueOptions = [...new Set(newOptions)];
|
|
|
|
this.editField.attributes.data.options = uniqueOptions;
|
|
}
|
|
}
|
|
};
|