All Questions
Tagged with vue-component typescript
281
questions
0
votes
1
answer
23
views
Vue.js: Watch Nested Property Changes and Trigger Method in a Deeply Nested Component Structure
I'm working with a Vue.js application where I need to watch changes on a nested property (isChecked) in a deeply nested component structure. My goal is to trigger a method (sumOfChecked) whenever the ...
0
votes
1
answer
49
views
Binding multiple properties to a component using and object as props - Vue 3
I'm having a little problem binding multiple properties to a component using an object. When I use this component on any other page I expect to pass the props in matching the ContentOptions interface ...
0
votes
0
answers
26
views
Avoiding style-mismatch with computed value
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: ...
0
votes
1
answer
118
views
How to call the methods exposed by components in slots with Vue 3 Composition API
There are some components (child component) in a slot (in parent component) and I want to call the methods on them. I tried the following steps:
Retrieve the child components as objects with useSlots
...
1
vote
2
answers
124
views
Array of string inputs in Vue 3?
I'm trying to present a form using Vue 3 that will contain a list of text input fields. The fields map to a string[] with a fixed length. I'd like to be able to set each field's v-model to the ...
0
votes
0
answers
40
views
Check function parameter type during runtime
i have an vue 3 library with typescript. Currently the library is released with a FooFunction type, but i need to change the function definition and change the parameter to another type(...
0
votes
2
answers
47
views
How to dynamically switch between two images onclick in Vue.js
I am trying to switch images on click in Vue.js. My code isn't working but this is what I am trying to make happen:
On load the image is black, after clicked/selected the image switches and turns into ...
0
votes
1
answer
38
views
(Vue3) Link form component object with parent object using v-model and Options API?
My question is simple. I am following the official Vue documentation explaining v-model arguments in relation to forms in a child component. Here's my code:
(App.Vue)
<script>
import UserName ...
0
votes
0
answers
37
views
Re-render <v-select> text on data change
When I change the data (CurrentClientAssignment) using javascript, why does the displayed text not update in the v-select? How does the v-select displayed text get rendered in general?
client v-select ...
0
votes
1
answer
210
views
Adding a Tailwindcss class name using a Vue.js computed method
I am trying to use some methods and functions to generate a predefined tailwind class name for a component. The class name works fine as a static form. but when I use the computed method and my ...
1
vote
1
answer
678
views
vue 3.3 generics and conditional properties
I am exploring the generics feature on vue 3.3
and I have this idea of defining the type of an incoming prop based on the value of another prop value.
this is my actual component:
export interface ...
1
vote
1
answer
67
views
Multiple script blocks in a Vue SFC sharing imported symbol
I have a Vue SFC with two <script> blocks: one for setup, and one for vue router's beforeRouteEnter handler that can't be used in setup. They both may use some of the same imports. When running ...
1
vote
0
answers
68
views
Wrong expected props in Vue3 custom component (TS)
I defined union type ComponentProps inside my component which may match with LinkComponentProps or BlockComponentProps. So, as I understand, when i passing to the component :is="link" prop, ...
1
vote
0
answers
206
views
How to define an interface that VueJS dynamic components must implement?
I am making a form dialog which is meant to be generic with regard to the kind of form it embeds. For this purpose, I use VueJS dynamic components to define which kind of form a particular dialog ...
0
votes
1
answer
44
views
How can I pass property to dynamic Vue component in code
I'm using Vue2 and TypeScript and I want to pass multiple properties to a Vue component in code. The component is not mounted via a template but in code. I dynamicly create an element in the DOM and ...