skip to Main Content

v-for for nested object – Javascript

Trying to do a v-for for nested object. const products = { Shorts: "/shorts", Socks: "/socks", Shoes: { "Shoes4men": "/shoes4men", "Shoes4women": "/shoes4women", "Shoes4kids": "/shoes4kids", }, } In frontend then: <div v-for="(link, product) in products" :key="product" :value="link"> {{ product }} {{…

VIEW QUESTION

How do I change the brightness of an image? – Javascript

I want to make a simple web photo editor. I need to change the brightness, contrast. Here's the code. <script setup lang="ts"> import { ref } from 'vue' import { getFromDB } from './db.ts' const data=ref(getFromDB()) const img=ref<HTMLImageElement>() const onLighter=()=>img.value.style['filter']='brightness(120%)';…

VIEW QUESTION

So how can I listen to an event in a Vue component, emitted from another component? – Javascript

So I have my app.js import { createApp } from 'vue'; import ProductsGrid from './components/ProductsGrid.vue'; import Cart from './components/Cart.vue'; import NavLink from './components/NavLink.vue'; import Navbar from './components/Navbar.vue'; const app = createApp({ components: { 'products-grid': ProductsGrid, 'cart': Cart, } }); app.mount('#app');…

VIEW QUESTION
Back To Top
Search