47 questions
2
votes
1
answer
138
views
Render slot with or without wrapper depending on the prop in Vue 2
I have a simple component that just adds styling to a slot. Styling part is not complicated: it just adds padding/margin/border/background color based on passed props, that's it.
Right now there's a ...
0
votes
1
answer
372
views
Vue3 - slot with v-model html rendered with render function
In vue3 I have this:
<template>
<ChildComponent>
<div>
<input type="text" v-model="myValue"/>
</div>
</ChildComponent>
</...
1
vote
1
answer
172
views
when use component template ref then get null in vue3 render function
I attempted to refactor Vue SFC (Single File Component) code into Vue render (h), functions, but encountered an issue with using component template references in the children property of the render ...
2
votes
1
answer
89
views
bind event didn't work in render function
this is the component BadCodeSelector, it emit an function confirm, when button clicked, the method confirm worked.
<template>
<div class="BadCodeSelector-buttons">
<el-...
2
votes
2
answers
1k
views
prop is not reactive when passed down in render function
Reproducer: https://stackblitz.com/edit/vue-tjt1qp?file=src/components/ParentComponent.js
In the reproducer above, I expect the child to behave in the same way as the parent.
I am trying to pass props ...
0
votes
2
answers
13k
views
How to get a change of prop of useSlot() in Vue 3
I have a question about how to get the change of props retrieved from useSlots()
this is a file declaring Parent component with Child component as Parent component's slot. Also I passed some props to ...
3
votes
2
answers
2k
views
Vue3 composable with render
Is it possible to create a composable function that would use render function so it can display something?
Example:
import { h } from 'vue'
export function useErrorHandling() {
return {
render()...
1
vote
1
answer
2k
views
Use Vue 3 Render Function With vuetify 3 beta
Hello every One I Have Some Problem That I beleive It Came From Vite Complier
i use vue 3 & vite with vuetify 3 beta And i need to use render function with vuetify
But every Time I try to import ...
0
votes
1
answer
841
views
How to make the loop (v-for) dynamic inside h (Vue.JS) function?
I have a reactive variable list either ref or reactive
in a vue.Js project
and i create an app that depends on this list(reactive)
let list = ref(['item']);
let vNode = h(
'ul',
list.value.map((v,...
0
votes
2
answers
851
views
Vue.js remove contenteditable attribute in render function
it seems should be a simple solution but something went wrong...
I need to conditionally remove contenteditable attribute from element:
<!-- first state -->
<div contenteditable="true&...
2
votes
2
answers
2k
views
Do Vue.js render functions allow return of an array of VNodes?
I am working on extending a Vue.js frontend application. I am currently inspecting a render function within a functional component. After looking over the docs, I had the current understanding that ...
3
votes
1
answer
2k
views
How to pass dynamic props to vue's render function?
I try to render components dynamically based on descriptions.
From
{component: 'customComponent', props: {value: "val1"}, ...}
I'd render
<custom-component :value="val1" @input=...
2
votes
3
answers
11k
views
vue submit form with updated input values
I have a simple hidden form
<template>
<form ref="form" method="POST" action="https://target.com/post" accept-charset="utf-8">
<input type=&...
3
votes
3
answers
3k
views
Are `h` and `createVNode` the same?
Both h and createVNode are exposed from vue.
The doc seems to suggest they are the same:
The h() function is a utility to create VNodes. It could perhaps more accurately be named createVNode().
But ...
2
votes
1
answer
1k
views
Vue.js - Performance cost of update and render of an array
I have a problem with array items rerendering. I hope someone can help me with it.
There is a code:
https://codesandbox.io/s/vuex-store-forked-2qx1g?file=/src/App.vue
We have component with array of ...
1
vote
1
answer
1k
views
Combining class names in Vue Render Function
I have a Vue 2 component using the render function like so:
export default {
name: "u-skeleton",
render(createElement) {
return createElement("div", {
attrs: {
...
3
votes
1
answer
1k
views
How to use slot in Vue 2 render function?
I'd like to do the following, but with Vue 2's render function
<template>
<imported-component>
<template v-slot:default="{ importedFunction }">
<button @...
11
votes
2
answers
22k
views
Vue 3: resolveComponent can only be used in render() or setup()
I'm trying to render a template in Vue 3. The template contains a component, which is locally registered on the instance.
import template from './template'
import RenderlessPagination from "./...
1
vote
1
answer
170
views
Avoid mutating a prop directly (render function)
just trying out creating components with the render function, but I am getting a weird warning:
Following component:
import Vue, { CreateElement, VNode } from 'vue'
export default Vue.extend({
...
0
votes
2
answers
192
views
Hide-Show N divs with Vuejs and @click [beginner]
I am confused on how to hide and show 3 divs according to the click.
I have been able to show and hide 2 divs with v-show but v-show does not apply I think for more than 2 divs.
This is my code ...
8
votes
3
answers
5k
views
How to enhance an existing Laravel project with VueJS?
I just finished my project using only the Laravel framework. Now I want to add vue.js into my project to render the views without loading them. I went through some tutorials and found that I need to ...
2
votes
0
answers
298
views
Convert Vue component to base64
I have a library of icons (icon system) in svg. Each svg has his own component inside Vue in the same way as Sarah Drasner's icon system.
I want to import an svg into a js library which allow only ...
0
votes
1
answer
798
views
How do I inject data from the server into a Vue CLI app?
I have a Vue CLI app that I want to connect to a server back-end.
The server will return a view template with a data payload, and I want to inject that payload as JSON into the Vue app as a data ...
0
votes
0
answers
1k
views
"nativeOn" vs. "on" in the render function & JSX
In the Vue documentation at https://v2.vuejs.org/v2/guide/render-function.html#The-Data-Object-In-Depth there is an explanation for “on” and “nativeOn”:
// Event handlers are nested under `on`, though
...