瀏覽代碼

fix the value of autocomplete when using the remote data

chenxin0723 1 年之前
父節點
當前提交
8ad1f6787a
共有 2 個文件被更改,包括 10 次插入1 次删除
  1. 0 0
      vuetifyx/vuetifyxjs/dist/vuetifyxjs.umd.min.js
  2. 10 1
      vuetifyx/vuetifyxjs/src/components/Autocomplete.tsx

文件差異過大導致無法顯示
+ 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() {

部分文件因文件數量過多而無法顯示