From 9df9e5bd7c0eaa07a06e653ab202b757c705afc0 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Thu, 10 Feb 2022 11:13:58 +0800 Subject: [PATCH] fix $ is not a function bug --- .../assets/vue/components/general/forms/SelectableComponent.vue | 2 +- resources/views/vendor/js.blade.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/assets/vue/components/general/forms/SelectableComponent.vue b/resources/assets/vue/components/general/forms/SelectableComponent.vue index ab0ed0b5..d86c35cc 100644 --- a/resources/assets/vue/components/general/forms/SelectableComponent.vue +++ b/resources/assets/vue/components/general/forms/SelectableComponent.vue @@ -34,7 +34,7 @@ if(!success){return;} let vm = this; - let mappedList = $.map(response.payload.data, function(value){ + let mappedList = response.payload.data.map(function(value){ let preservedValue = value; return {'id': !isNaN(value[vm.valueColumn]) ? parseInt(value[vm.valueColumn]) : value[vm.valueColumn], 'text': vm.labelColumn.map(function(label){ diff --git a/resources/views/vendor/js.blade.php b/resources/views/vendor/js.blade.php index 9adee26b..f56b59e4 100644 --- a/resources/views/vendor/js.blade.php +++ b/resources/views/vendor/js.blade.php @@ -5,6 +5,7 @@ 'baseUrl' => url('/'), 'routes' => collect(\Route::getRoutes())->mapWithKeys(function ($route) { return [$route->getName() => $route->uri()]; }) ]) !!}; + window.$ = window.jQuery = require('jquery');