Ver Fonte

Merge pull request #40 from qor5/fix-vautocomplete-selectitem

Fix the value when use the vautocomplete as selectitem
Chenyang há 1 ano atrás
pai
commit
c681b21997

Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
vuetifyx/vuetifyxjs/dist/vuetifyxjs.umd.min.js


+ 6 - 1
vuetifyx/vuetifyxjs/src/components/Autocomplete.tsx

@@ -77,6 +77,12 @@ export default Vue.extend({
 			}
 		},
 		changeStatus(vals: any) {
+			if (!this.remoteUrl || !this.eventName) {
+				this.value = vals;
+				this.$emit("change", vals);
+				return;
+			}
+
 			const cachedSelectedItems: any[] = [];
 			vals.forEach((val: any) => {
 				this.listItems.forEach((item: any) => {
@@ -93,7 +99,6 @@ export default Vue.extend({
 				));
 			});
 			this.cachedSelectedItems = (uniqueCachedSelectedItems) as [];
-			console.log("cachedSelectedItems", this.cachedSelectedItems);
 			this.value = vals;
 			this.$emit("change", vals);
 		},

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff