File tree Expand file tree Collapse file tree 1 file changed +14
-26
lines changed
packages/Webkul/Admin/src/Resources/views/components/attributes/edit Expand file tree Collapse file tree 1 file changed +14
-26
lines changed Original file line number Diff line number Diff line change @@ -139,43 +139,31 @@ class="px-4 py-2 text-center text-gray-500"
139139 };
140140 },
141141
142- mounted () {
143- this .initializeValue ();
144-
145- window .addEventListener (' click' , this .handleFocusOut );
146- },
147-
148142 watch: {
149- value: {
150- deep: true ,
151-
152- handler () {
153- this .initializeValue ();
154- },
155- },
156-
157143 searchTerm (newVal , oldVal ) {
158144 this .search ();
159145 },
146+
147+ value (newVal , oldVal ) {
148+ if (newVal) {
149+ this .getLookUpEntity ();
150+ }
151+ },
152+ },
153+
154+ mounted () {
155+ if (this .value ) {
156+ this .getLookUpEntity ();
157+ }
158+
159+ window .addEventListener (' click' , this .handleFocusOut );
160160 },
161161
162162 beforeDestroy () {
163163 window .removeEventListener (' click' , this .handleFocusOut );
164164 },
165165
166166 methods: {
167- initializeValue () {
168- if (this .value ) {
169- if (this .value .id && this .value .name ) {
170- this .entityId = this .value .id ;
171-
172- this .selectedItem = this .value .name ;
173- } else if (this .value .id ) {
174- this .getLookUpEntity (this .value .id );
175- }
176- }
177- },
178-
179167 toggle () {
180168 this .showPopup = ! this .showPopup ;
181169
You can’t perform that action at this time.
0 commit comments