question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

New render function Vue 2

See original GitHub issue

Hi,

Thank you for such a great package. Can you please provide any example for Instead of Vue.partial for custom option templates you can use a custom render function. Sorry, if I missed something in docs but I really tried to find before asking 😃

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
shentaocommented, Nov 23, 2016

Thanks! However, now that scoped slots are released (Vue v2.1), I think I can change this to a simple scoped slot.

<multiselect config-props-here>
  <template slot="option" scope="props">
     <span class="friends-list-item" :id="'friends-list-item-" + props.friend.name>
       <img src="props.friend.avatar_url">
       {{ props.label }} 
     </span>
  </template>
</multiselect>

Or something similar. Will have to try it out soon. 😃

1reaction
shentaocommented, Oct 26, 2016

Thanks for the kind words!

Sadly the docs for 2.0 are still in progress. 😦 Here is an example how such render function can look: https://github.com/monterail/vue-multiselect/blob/2.0/src/Multiselect.vue#L189 This is the default render function that is used, so this is also the props to which you have to pass the new render function.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Render Functions & JSX - Vue.js
That's where you can use the render function, a closer-to-the-compiler alternative to templates. Let's dive into a simple example where a render function...
Read more >
Vue Render Functions: What (and How) to Use Them - Snipcart
Each Vue component implements a render function. Most of the time, the function will be created by the Vue compiler. When you specify...
Read more >
VueJS - Render Function - Tutorialspoint
Render function takes createElement as the argument and returns the same. CreateElement creates the DOM element the same way as in JavaScript.
Read more >
When to use a Vue Render Function - VueDose
There are very few cases where you should be using a render function instead of regular templates to create components in Vue.js.
Read more >
javascript - Vue 2: How to render Single File Components from ...
If I understand correctly, you simply want to render components that may be written as single file components from a render function.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found