Category : typescript

so I am trying to get the active user off of a fetch request to my backend. My front end code is: let apiToken: string | null = document.querySelector(‘meta[name="csrf-token"]’).getAttribute(‘content’); fetch(‘http://192.168.0.6:8000/api/testURL’, { method: "POST", //@ts-ignore headers: { ‘Content-Type’: ‘application/json’, ‘Accept’: ‘application/json, text-plain, */*’, ‘X-Requested-With’: ‘XMLHttpRequest’, ‘X-CSRF-TOKEN’: apiToken }, credentials: ‘same-origin’, body: JSON.stringify(data) }) .then(function(response): void { ..

Read more

I have one application named MyProject which OAuth credentials are: now I want to add login with my project in my second project. how can I do that because my second project is made in laravel as backend and angular and typescript as a front end? my first project is normal PHP. <a href="http://localhost/myproject/oauth.php?app_id=1234&&secret=5678">Login with ..

Read more

Trying to get locales in my components but I get this error: [Vue warn]: Property or method "welcome" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties. Code commented each file for ..

Read more

I have dynamic fields where I can add/remove inputs and get array of inputs to send to my back-end but it always sends values of my array as [Object Object] Code <div class="col-md-12"> <vs-row> <vs-table> <template #tbody> <vs-tr v-for="(row, index) in form.titles" :key="index"> <vs-th><strong>Title</strong></vs-th> <vs-td> <vs-input ref="titled" v-model="row.title"></vs-input> </vs-td> <vs-td> <vs-button icon color="danger" border type="button" ..

Read more

I started a project with Vuejs and Laravel using Laravel Mix. It works for the most part, but when I’m trying to divide my component up into separate files and load them in the .vue file like this: <template src="./comp.html"></template> <script src="./comp.ts" lang="ts"></script> <style src="./comp.scss" scoped lang="scss"></style> I’m getting this error: error in ./resources/js/components/comp/comp.html?vue&type=template&id=c2090546&scoped=true Module ..

Read more

I using react, I want to use absolute path when import component. so I customized webpack.mix.js like below code. That’s worked well in browser. But VScode show error. Could not find a declaration file for module const mix = require(‘laravel-mix’); /* |————————————————————————– | Mix Asset Management |————————————————————————– | | Mix provides a clean, fluent API ..

Read more