Closed tarundak closed 2 years ago
do you use composition api on your vue3 + vite?, if yes, please avoid calling $ symbol to your setup function, so try this instead:
import { $array as useArray, $object as useObject } from '../assets/alga.min.js' (please use compress/minify js file instead)
also you can do:
import { pagination } from 'alga-js/lib/array.js'
and what a browser do you use? but it works fine for me and no error at all
hello am using vue 3 and laravel no vite but getting an error when i try to import
app.js:26405 Uncaught TypeError: (0 , alga_js_array__WEBPACK_IMPORTED_MODULE_1__.paginate)(...) is not a function am getting this error
"Uncaught TypeError", I think this is because of the return value from paginate is null or nan, below this, its the code for that paginate function
const paginate = (fromArray, pageActive = 1, limitPerPage = 10) => { const newArray = Array.from(fromArray) const startPaginate = (Number(limitPerPage) Number(pageActive)) - (Number(limitPerPage) - 1) const endPaginate = Number(limitPerPage) Number(pageActive)
return newArray.slice(startPaginate - 1, (endPaginate <= newArray.length) ? endPaginate : newArray.length) }
can you help me i have this problem with vue3 + vite
I have imported import { $array, $object } from '../assets/js/alga.js'
but I am getting below error Unhandled Promise Rejection: ReferenceError: Can't find variable: $array