Skip to content
Advertisement

Tag: vue.js

include tailwind css in bundle js

How could I include tailwind css in bundle js ? this is the an example with vue 3 and tailwind 3 https://github.com/musashiM82/vue-webpack. running npm run build , it creates 3 files: app.js ABOUTPAGE.js app.6cba1802.css I want to include app.6cba1802.css into app.js, so the result should be: app.js ABOUTPAGE.js Thanks Answer You can use the css.extract option from vue cli :

How to access Nuxt context inside of fetch() hook?

I want to access the props inside the async fetch() but I’m also using async fetch(context). So, I’m not sure how to access the props. Answer In Nuxt 2, you have 2 fetch hooks. The old one, before Nuxt 2.12, fetch(context) which acts a lot like asyncData. It’s executed before the component creation, so you don’t have access to it

Split array data from fetch data

I fetch this data from the api then i want to split this into two array i try using split function but it didn’t work, when i check for array.length, console said it undefined. when i console.log(array) it show like this Help me please. Answer First, This is not an array it’s an object. You can use Object.keys and Object.value

Vue 3 – can i avoid using .value everywhere?

I’m quite new to Vue 3 and i’m struggling a lot to understand some concepts of the composition API. I’m trying to port a library i’m using from vue 2 to vue 3, and in a parent element a reactive property called layout is passed to children components. So in the parent component i’m returning layout to the children like

Advertisement