Skip to content
Advertisement

Tag: typescript

Access data property of child component from parent vue 3 typescript and composition api

I have setup two components parent and child: App.vue //Parent BookForm.vue //child I’ve followed this thread from vue forum for the solution but I cannot retrieve data from child component into parent component. When I console log console.log(bookRef.value) I get undefined. What is the correct way to get child component’s data with typescript and composition api setup tag ? Answer

How to read the content of an Axios post response?

When I send the same POST request with a cURL command, I get this as response: When I add the POST request in my code and print it with console.log(“response: “, response); or console.log(“response: “, response.data); , I get this printed How can I see the content of the response printed in my logs? Answer You can use console.log(“response: “,

Object Literal instead of switch

I would like to use object literal instead of switch statement, but i got this error: Element implicitly has an ‘any’ type because expression of type ‘string’ can’t be used to index type ‘{ apple: string[]; orange: string[]; watermelon: string[]; default: void; }’. No index signature with a parameter of type ‘string’ was found on type ‘{ apple: string[]; orange:

JS/TS: Getting access to a value wrapped in a promise?

I have an Object where the key is a stringified object and the value is a Promise that eventually resolves to a font object. I use Promise.all to wait for them all to resolve. After this, I log the object in console and it looks like: I want to enumerate through the object to ensure each postscript name in they

Advertisement