vue-void

0.1.2 • Public • Published

Vue Void

Before vue@2.5.3, the following code:

<template slot="..."></template>

...results in clearing the slot content. But in later versions this will reveal the fallback content instead.

To clear the fallback content of a predefined slot, the quickest way seem to be using a zero-width space (&#8203;) in the template. But it does look hacky. Let's hide the hack under the hood and use a more semantic approach.

This component renders nothing except a zero-width space so you can now clear a slot like this:

<template slot="..."><v-void/></template>

It'll be more ideal if Vue can support this in its core with something like:

<template slot="..." void></template>

void/blank/no-fallback/... are all fine as long as it's explicit on the purpose.

Readme

Keywords

none

Package Sidebar

Install

npm i vue-void

Weekly Downloads

1

Version

0.1.2

License

none

Unpacked Size

3.48 kB

Total Files

6

Last publish

Collaborators

  • justineo