Socket
Socket
Sign inDemoInstall

wire-vue

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    wire-vue

Utility library for Vue that helps get reactive data from [Wire](https://github.com/WiresWare/wire_ts) data-container layer by providing special component `<WireData />`


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Wire Vue

Utility library for Vue that helps get reactive data from Wire data-container layer by providing special component <WireData />

How to

  1. Dependency:
npm i -D wire-vue cores.wire
or 
yarn add -D wire-vue cores.wire
  1. Vue plugin:
import { createApp } from 'vue';
import WireVue from 'cores.wire-vue';
import App from './App.vue';

createApp(App)
  .use(WireVue) 
  .mount('#app');
  1. Use: (simple)
  <WireData
    v-slot="{ has, data }"
    :for="DataKeys.COUNT"
    :when="() => true"
  >
    <h1>{{ has ? data : 'no data' }}</h1>
  </WireData>

(with naming slots)

  <WireData :for="DataKeys.COUNT" :when="() => true">
    <template #default="{ data }">
      <h1>{{ data }}</h1>
    </template>
    <template #undefined>
      <p>Value is undefined</p>
    </template>
  </WireData>
  1. Update WireData from anywhere in the app:
const count = ref<number>(Wire.data(DataKeys.COUNT).value);
watch(count, (value: number) => Wire.data(DataKeys.COUNT, value));

FAQs

Last updated on 24 Jan 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc