All Questions
24 questions
-1
votes
1
answer
85
views
Blank background-image in vue.js
For a website, i want 70% of the page to be covered with an image. However the image is just blank.
I use Vue.js as my frontend. Here is the code that results in a blank space:
<script setup lang=&...
0
votes
2
answers
2k
views
Vue 3 composition API pass array props through many children
I need to pass an array from component A (App.vue) through component B to component C. What I do is this (this first step works, just read it to understand):
// A.vue
<script setup>
import B ...
1
vote
4
answers
4k
views
Why doesn't the component tag in Vue3 work properly for dynamically rendering components?
I'm just learning Vue and trying to learn dynamic rendering using the component tag. What is the problem with this code? No errors are displayed in the console, but clicking on the buttons still does ...
3
votes
2
answers
5k
views
How to clear "Slot 'default' invoked outside of the render function" warning? Vue3, Composition API
The full warning message:
[Vue warn]: Slot "default" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render ...
1
vote
4
answers
449
views
Setting input attributes with props and <script setup>
Is it possible to set a form input type using a prop?
The below does not seem to work, any others ways to do this?
For example
<script setup>
defineProps({
InputType: String,
InputId: String,...
1
vote
2
answers
1k
views
Can I import a component in Vue.js with path based on prop?
I am using the Material design Icons library for Vue.js.
This library contains a folder and every icon is a single file component in that folder.
I have another component, ToolbarButton, that has a ...
1
vote
1
answer
1k
views
How to create a SetTimeout for a message alert component in Vue 3 Composition API?
I am getting started with Vue. I am struggling to create a SetTimeout for a message alert component.
My component looks like this:
<script>
export default {
name: "Message",
...
1
vote
1
answer
374
views
Vue Script setup in build imports not accessible
My Problem is when I use setup I can't access it in normal script but only after I build the application in Dev mode anything works fine. In this example, I can't access this.authStore in my logout ...
2
votes
2
answers
6k
views
How to get the route parameter in the VueJs 3 composition Api
I need a route parameter in a VueJS componente. For example the 42 in example.de/page/42.
// router
// ...
{
path: '/pages/:id',
name: 'pages',
component: () => import('../...
2
votes
1
answer
1k
views
Vue.js composition API <script setup> - how to two-way bind props
I am struggling to find a way how to create two-way props binding between parent and child components using Vue.js3. Below you can find an example of my code. Unfortunately, the "emit" ...
-1
votes
1
answer
474
views
How to scrollIntoView in vue composition api that use script setup?
I have a parent app(parent.vue) that emit value from child app(MainMenu.vue) that used to scroll in spesific pageview by id in parent app, but when i run it give the error message TypeError: document....
3
votes
1
answer
1k
views
Vue - Why setup with reactive when you can do it easily with data option?
I am currently building a login for a Vue app. In a tutorial (02/2021) I see that the colleague creates a setup method and imports a Vue reactive object into the component. Just to collect the form ...
0
votes
2
answers
2k
views
Changing prop of component in vue.js with composition API
How can I change the prop value of a component and notify these components about the change?
Parent.vue
<script setup>
import Child from './Child.vue'
const finished = ref(false)
function ...
5
votes
3
answers
7k
views
Change ref of the parent from child component using Vue 3
I have a child component called Navbar. A logout is an option in the Navbar.
<a @click="(event) => {event.preventDefault();}">
Logout
</a>
I have imported this Navbar into ...
1
vote
1
answer
2k
views
Vue 3: How to get boolean data from parent (using <script setup>) into child?
Firstly, I know this is probably a SUPER easy question, but I've been struggling for an hour and half and I'm kinda done with that. First vue project ever, so I've never had 2 components talk to each ...