File tree Expand file tree Collapse file tree 1 file changed +3
-31
lines changed
packages/Webkul/Admin/src/Resources/views/components/attributes/edit Expand file tree Collapse file tree 1 file changed +3
-31
lines changed Original file line number Diff line number Diff line change @@ -158,29 +158,15 @@ class="cursor-pointer border-t border-gray-800 px-4 py-2 text-gray-500 hover:bg-
158158 };
159159 },
160160
161- mounted () {
161+ mounted () {
162162 if (this .value ) {
163163 this .getLookUpEntity ();
164164 }
165- },
166-
167- created () {
168- window .addEventListener (' click' , this .handleFocusOut );
169- },
170165
171- beforeDestroy () {
172- window .removeEventListener (' click' , this .handleFocusOut );
166+ window .addEventListener (' click' , this .handleFocusOut );
173167 },
174168
175169 watch: {
176- value: {
177- deep: true ,
178-
179- handler () {
180- this .initializeValue ();
181- },
182- },
183-
184170 searchTerm (newVal , oldVal ) {
185171 this .search ();
186172 },
@@ -206,18 +192,6 @@ class="cursor-pointer border-t border-gray-800 px-4 py-2 text-gray-500 hover:bg-
206192 },
207193
208194 methods: {
209- initializeValue () {
210- if (this .value ) {
211- if (this .value .id && this .value .name ) {
212- this .entityId = this .value .id ;
213-
214- this .selectedItem = this .value .name ;
215- } else if (this .value .id ) {
216- this .getLookUpEntity (this .value .id );
217- }
218- }
219- },
220-
221195 toggle () {
222196 this .showPopup = ! this .showPopup ;
223197
@@ -254,9 +228,7 @@ class="cursor-pointer border-t border-gray-800 px-4 py-2 text-gray-500 hover:bg-
254228 .then (response => {
255229 const [result ] = response .data ;
256230
257- this .entityId = result .id ;
258-
259- this .selectedItem = result .name ;
231+ this .selectedItem = result;
260232 })
261233 .catch (error => {});
262234 },
You can’t perform that action at this time.
0 commit comments