Skip to content

zWingz/vue-with-wrapper

Repository files navigation

vue-with-wrapper

A object deconstruction in Vue

CodeSandbox

Notice

It is a functional component

Example

Pass any props

<template>
  <div>
    <with :e="a.b.c.d.e" :f="123" :b="a.b" :parse="parseObj()">
      <template #default="{ e, f, b, parse }">
        {{e}}
        <br>
        {{f}}
        <br>
        {{b}}
        <br>
        {{parse.b}}
        {{parse.c}}
        {{parse.d}}
      </template>
    </with>
  </div>
</template>

Pass object with v-bind

<template>
  <div>
    <with v-bind="someData">
      <template #default="{ data_1, data_2, data_3 }">
        {{data_1}}
        {{data_2}}
      </template>
    </with>
  </div>
</template>
<!-- someData = { data_1: 1, data_2: 2, data_3: 3} -->

About

vue with wrapper

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy