Browse Source

fix the value of autocomplete when using the remote data

chenxin0723 1 year ago
parent
commit
8ad1f6787a

File diff suppressed because it is too large
+ 0 - 0
vuetifyx/vuetifyxjs/dist/vuetifyxjs.umd.min.js


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

@@ -119,7 +119,16 @@ export default Vue.extend({
 	created() {
 		this.listItems =  this.$props.items || [];
 		this.value = (this.$attrs.value) as any || [];
-		this.cachedSelectedItems = this.value;
+		if (this.remoteUrl) {
+			this.cachedSelectedItems = this.value;
+			this.listItems =  this.value;
+
+			const vals: any[] = [];
+			this.value.forEach((val: any) => {
+				vals.push(val.value);
+				this.value = vals as any;
+			})
+		}
 	},
 
 	mounted() {

Some files were not shown because too many files changed in this diff