Skip to main content
Filter by
Sorted by
Tagged with
3 votes
2 answers
155 views

I have a class used in my VueJS project. I have a function on it which returns a calculated value. If I make this a computed property then it works fine in my VueJS application. However, Typescript ...
El_T's user avatar
  • 33
1 vote
1 answer
75 views

I’m studying TypeScript and came across this pattern: type Animal = { [key: string]: number }; let Tiger: Animal = { legs: 4, age: 5, tail: 1, eyes :2 }; From what I understand, this allows adding ...
Reema's user avatar
  • 23
0 votes
0 answers
41 views

I would like to disable the submit button in my Vue application if the user hasn't entered data in the donationInput input field. I'm sure I'm missing something basic, thanks for your help identifying ...
Nick Bewley's user avatar
  • 9,319
3 votes
2 answers
3k views

I'm trying to make my code as reactive as possible, switching from explicit route subscription to withcomponentinputbinding. export class CustomerProfileComponent { private readonly oms = inject(...
Jens R.'s user avatar
  • 198
0 votes
1 answer
66 views

I am trying to make a pagination for my Bostorek project. I used computed property to calculate the start index and end index then slice the array of book objects to show the necessary part of that ...
Canberk Ekinci's user avatar
0 votes
1 answer
4k views

I am having a hard time wrapping my head around the concept of Signals and Computed Properties. I have some dummy data, dummyTasks, that is a simple array of task objects, and a selectedUserTasks ...
Adam's user avatar
  • 3
0 votes
0 answers
205 views

With SwiftData's @Query macro, I get an array of model items. Then, I use a computed property to group the items. The computed property is used twice in my view and is therefore also computed twice. ...
Mink96's user avatar
  • 1
1 vote
1 answer
360 views

I am struggling for days with this problem and I didn't find any solution even on the internet. The problem is that I have a computed property with a getter and a setter but its setter is not being ...
Saad Mtsm's user avatar
0 votes
2 answers
50 views

I migrate from Vue 2 to Vue 3 code. And I have a problem with computed properies. html: <div id="cartStatePopupApp" v-if="isShow"> <!-- v-show="isShow" does not ...
Viktor Bylbas's user avatar
0 votes
1 answer
508 views

I'm reviewing some Vue code where the developer has assigned a computed value to a ref property. I've never seen this done before, and although it works, it seems odd to me. Are there any potential ...
Josh's user avatar
  • 958
0 votes
0 answers
52 views

My goal is to render a list of elements randomly placed inside a grid. I tried to achieve this with the cue-computed property. But unfortunately I'm always getting the error: - rendered on server: ...
IamSebastn's user avatar
0 votes
1 answer
252 views

Im trying to use Vue3, Vuetify v-data-table component.Without 'return-object' all works fine, im getting id, but i want to get user objects. So the problem is when i click on select all checkbox first ...
Alex's user avatar
  • 1
1 vote
2 answers
2k views

I'm trying to use singals and computed in my new Angular project, but I'm running into a problem. I have a computed value, which contains an id, which is a number. This id will be set by user ...
LetzFlow's user avatar
  • 481
-1 votes
1 answer
221 views

I am trying to mock CMMotionManager for unit testing. Here is my abbreviated code: protocol XMotionManager { var isDeviceMotionAvailable: Bool { get } var deviceMotionUpdateInterval: ...
Reinhard Männer's user avatar
0 votes
1 answer
78 views

Have a data source singleton with class hugestuff ..{ var dataSources: [String: ThingWithIncrediblyLargeArrays] .. var currentThing: String } ThingWithIncrediblyLargeArrays is indeed a ...
Fattie's user avatar
  • 9,780
2 votes
0 answers
285 views

I have code like this. It generates tabs object for my components export function generateRouterTabs (tabs?: RouteRecordRaw[] | undefined, tabsName?: string): { name: string tabs: IRouterTab[] } { ...
Гаджега Павло's user avatar
0 votes
1 answer
36 views

<Navbar v-if="showNavbar" /> const showNavbar = computed(() => route.name !== 'dashboard' && route.name !== 'dashboard_home' && route.name !== 'display' &...
Faixy's user avatar
  • 1
0 votes
0 answers
119 views

I am trying to build a multiselect component to nicely display tags in my app. I receive an objectTags parameter form the parent component, but this field needs to be slightly refactored to be ...
Léonard Krief's user avatar
-2 votes
1 answer
78 views

I have a struct ExampleStruct with a custom subscript. The struct data are a fixed private dictionary, value. The structure has one element Sum that is essentially a summation of the the other ...
G J's user avatar
  • 369
1 vote
2 answers
770 views

I have a function that returns a ComputedRef like below // a computed ref function const publishedBooksMessage = () => computed(() => { return books.length > 0 ? 'Yes' : 'No' }) To access ...
Nitheesh's user avatar
  • 20.1k
0 votes
1 answer
632 views

Good day, please tell me, is it possible to somehow change the behavior of Computed Property? What is happening here: we show a list of transactions that are dynamically grouped by dates import ...
bonavii's user avatar
  • 25
0 votes
1 answer
257 views

In my Vue project, I have a ref variable that contains some data loaded from a DB. As a reference, it lives inside a Pinia's setup store. My goal is to load the value only when requested by user, and ...
ALai's user avatar
  • 809
1 vote
1 answer
936 views

I have a SwiftData model and I want to use it with @Query that gets created when the app starts. And then I want to base an @State variable on that @Query variable. Like this (this is what I am ...
user2926337's user avatar
0 votes
1 answer
182 views

If I create a union type from the keys of an object, I can pass that type around perfectly, as long as the keys are regular strings. But if I use computed properties as keys for the object, ...
ShaneSauce's user avatar
-1 votes
2 answers
109 views

My model contais the following: public virtual DateTime LastSessionDate { get; set; } public virtual List<double> Values { get; set; } Values should be selected from other tables in a custom ...
jgayer's user avatar
  • 1
1 vote
1 answer
125 views

I'm quite new to SwiftUI, and I have the following problem. I have a for in loop inside a computed property, that doesn't update my view realtime, but only when the user interacts with another part of ...
Capitan_Jack_89's user avatar
3 votes
1 answer
6k views

I have this simple 2 component vue app : (nuxt, composition api and ts) Parent : <template> <input type="text" v-model="txt"> <Child :txt="txt">&...
moxyom's user avatar
  • 33
0 votes
2 answers
259 views

I'm expecting to display a computed getter property, but VSC gives me the error "Expected to return a value in 'features' computed property." Even though I'm returnng a true value in getter ...
john's user avatar
  • 25
1 vote
1 answer
1k views

I set up a flag foundInBrowser that informs me whether the entry 'aaa' is present in localStorage. Clicking on an input toggle adds/removes the entry, which in turn automatically updates the flag: <...
WoJ's user avatar
  • 30.7k
-1 votes
1 answer
879 views

I have need of a variable that retains the selected index into an array of objects. I need to make a function call whenever this index changes. I had thought that computed properties were the way to ...
iOSProgrammingIsFun's user avatar
3 votes
1 answer
889 views

I have an app that displays image arrays. Before the image is displayed I need to adjust cropping based upon the image dimensions. When I load the image in a vue child component, I use a computed ...
Lloyd Loftus's user avatar
1 vote
1 answer
893 views

I am migrating to Vue SFC and have problem using computed property. With the following code, I want to create two rows, and the visibility of the bottom row (the content row) can be toggled by ...
Ezon Zhao's user avatar
  • 801
0 votes
2 answers
464 views

EDIT - Found that sorting is quick, real issue is performance of rendering huge list, so already answered pls explain to me, why this does nothing: I have array of thousands of items, there is a ...
PM_KLS's user avatar
  • 101
1 vote
1 answer
465 views

I love vue.js and I definitely love computed properties and VueX getters. But I have come to a point where I am not sure if the way I am using them might have some drawbacks in terms of performance. ...
paro-paro's user avatar
0 votes
0 answers
17 views

I’d like to know how to build the Vuejs project architecture. At the start I’m fetching some object array in the template, passing it to the component as a computed getter. Next, I’m filtering the ...
user avatar
0 votes
0 answers
342 views

I have the following NestJS route set up: @Get(':id') async getUserInfo(@Param('id') id: string) { const res = await this.userService.findOneByField(id); console.log(res); return res; ...
Bowis's user avatar
  • 682
0 votes
1 answer
175 views

Can we do get and didSet together with lazy keyword. I have an array it fetch data from database (get) and another thing when that array will modify i will call delegate to reload data in didSet. Its ...
Yogesh Patel's user avatar
  • 2,037
0 votes
1 answer
324 views

I have a question about the difference between the following 2 ways to create a computed property for class in kotlin. for the code below, doesn't it break what val is meant for, i.e. a val variable ...
user3463521's user avatar
1 vote
1 answer
9k views

I have a situation where I need to create a computed property from a pinia store getter - import { computed} from 'vue' import { storeToRefs } from 'pinia' import {useMyStore} from './../stores/...
WillardSolutions's user avatar
-2 votes
2 answers
138 views

I have a component with v-for on list and I want to check if the component is checked or not whenever there is change in the list and update the checked state. // This works but not the suggested way ...
Vishal Sagar's user avatar
2 votes
2 answers
862 views

i'm trying to update a variable on the status of a HTMLInputElement, but the watch method doesn't react on a change from the input field. const input = ref<HTMLInputElement | null>(null) const ...
Truut's user avatar
  • 83
1 vote
1 answer
1k views

For example: <MyComponent v-model="thisComputed" /> Where thisComputed is a computed property. I do not know if it is possible. If is, then how?
Tamás László's user avatar
0 votes
2 answers
2k views

I have some pinia stores, like this: export const common = defineStore('common', { state: () => ({ banner: null, ... }), getters: { hasBanner(state) { return !!state.banner ...
lbloodl's user avatar
1 vote
0 answers
28 views

I found an issue with incorrect typings in our codebase that TypeScript provided no warnings for at all. I managed to narrow it down to a usage of computed properties. In the example function, we want ...
Nate Glenn's user avatar
  • 6,784
1 vote
0 answers
226 views

How can EF Core project computed properties to SQL instead of calculating them on the client side? public enum OrderType { Normal, Special, } public class Order { public int ...
Alois's user avatar
  • 431
0 votes
1 answer
234 views

I am trying to use mapState in my TypeScripted written Vue component. As advised here: How to use mapState function in typescript syntax when using vuex? I am doing this in order to achieve it: <...
Tom Carmi's user avatar
  • 664
0 votes
1 answer
194 views

Im building a vue application for quizzes, I want to display the all the previous results of the person that has taken the quiz. For that I fetch the results from my backend and then pass them to the &...
Ibrahim's user avatar
  • 199
1 vote
2 answers
454 views

I have a table where I display information about a site. One of these information is the last time data was refreshed. On the top of the table, I would like to add an icon that appears only if the ...
Shinwi's user avatar
  • 139
0 votes
1 answer
44 views

I'm creating a stepper component with a v-for loop, which currently works without an issues: <li v-for="(step, index) in stepper" :key="step.id" class="goals-...
Gazillacode's user avatar
0 votes
3 answers
461 views

I have a pill shape that say's either Production or Development. I want the background color to be different depending on if it is production or development. I've done this before with option api, but ...
ironman33's user avatar

1
2 3 4 5
12