|
30 | 30 | )
|
31 | 31 | </template>
|
32 | 32 | <script>
|
33 |
| -import { isObject } from "lodash"; |
| 33 | +// import { isObject } from "lodash"; |
34 | 34 | import abstractField from "./abstractField";
|
35 |
| -import Multiselect from 'vue-multiselect'; |
| 35 | +import Multiselect from "vue-multiselect"; |
36 | 36 |
|
37 | 37 | export default {
|
38 |
| - mixins: [abstractField], |
39 |
| - components: { |
40 |
| - Multiselect |
41 |
| - }, |
42 |
| - computed: { |
43 |
| - options() { |
44 |
| - let values = this.schema.values; |
45 |
| - if (typeof(values) == "function") { |
46 |
| - return values.apply(this, [this.model, this.schema]); |
47 |
| - } else { |
48 |
| - return values; |
49 |
| - } |
50 |
| - } |
51 |
| - }, |
| 38 | + mixins: [abstractField], |
| 39 | + components: { |
| 40 | + Multiselect |
| 41 | + }, |
| 42 | + computed: { |
| 43 | + options() { |
| 44 | + let values = this.schema.values; |
| 45 | + if (typeof(values) == "function") { |
| 46 | + return values.apply(this, [this.model, this.schema]); |
| 47 | + } else { |
| 48 | + return values; |
| 49 | + } |
| 50 | + } |
| 51 | + }, |
52 | 52 |
|
53 |
| - methods: { |
54 |
| - updateSelected(value, id) { |
55 |
| - this.value = value; |
56 |
| - }, |
57 |
| - onSelect(selectedOption, id) { |
58 |
| - console.log("onSelect", selectedOption, id) |
59 |
| - }, |
60 |
| - onRemove(removedOption, id) { |
61 |
| - console.log("onRemove", removedOption, id) |
62 |
| - }, |
63 |
| - onSearchChange(searchQuery, id) { |
64 |
| - console.log("onSearchChange", searchQuery, id) |
65 |
| - }, |
66 |
| - addTag(newTag, id) { |
67 |
| - console.log("addTag", newTag, id); |
68 |
| - // TODO: implement tag object by sending this function into schema definition |
| 53 | + methods: { |
| 54 | + updateSelected(value, id) { |
| 55 | + this.value = value; |
| 56 | + }, |
| 57 | + onSelect(selectedOption, id) { |
| 58 | + console.log("onSelect", selectedOption, id); |
| 59 | + }, |
| 60 | + onRemove(removedOption, id) { |
| 61 | + console.log("onRemove", removedOption, id); |
| 62 | + }, |
| 63 | + onSearchChange(searchQuery, id) { |
| 64 | + console.log("onSearchChange", searchQuery, id); |
| 65 | + }, |
| 66 | + addTag(newTag, id) { |
| 67 | + console.log("addTag", newTag, id); |
| 68 | + // TODO: implement tag object by sending this function into schema definition |
69 | 69 | /* const tag = {
|
70 | 70 | name: newTag,
|
71 | 71 | // Just for example needs as we use Array of Objects that should have other properties filled.
|
72 | 72 | // For primitive values you can simply push the tag into options and selected arrays.
|
73 | 73 | code: newTag.substring(0, 2) + Math.floor((Math.random() * 10000000))
|
74 | 74 | }*/
|
75 |
| - this.options.push(newTag) |
76 |
| - this.value.push(newTag) |
77 |
| - }, |
78 |
| - onOpen(id) { |
79 |
| - console.log("onOpen", id) |
80 |
| - }, |
81 |
| - onClose(value, id) { |
82 |
| - console.log("onClose", value, id) |
83 |
| - }, |
84 |
| - } |
| 75 | + this.options.push(newTag); |
| 76 | + this.value.push(newTag); |
| 77 | + }, |
| 78 | + onOpen(id) { |
| 79 | + console.log("onOpen", id); |
| 80 | + }, |
| 81 | + onClose(value, id) { |
| 82 | + console.log("onClose", value, id); |
| 83 | + } |
| 84 | + } |
85 | 85 | };
|
86 | 86 | </script>
|
0 commit comments