https://github.com/dammy001/vue-mono
vue mono component
https://github.com/dammy001/vue-mono
component library mono vue vue2 vue3 vuejs2
Last synced: about 1 year ago
JSON representation
vue mono component
- Host: GitHub
- URL: https://github.com/dammy001/vue-mono
- Owner: dammy001
- Created: 2021-01-28T19:26:24.000Z (over 5 years ago)
- Default Branch: next
- Last Pushed: 2022-04-03T09:26:02.000Z (over 4 years ago)
- Last Synced: 2025-03-15T06:48:07.713Z (over 1 year ago)
- Topics: component, library, mono, vue, vue2, vue3, vuejs2
- Language: Vue
- Homepage: https://www.npmjs.com/package/@damilaredev/vue-mono
- Size: 74.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vue-mono
# Mono Component for Vue 3.x
A Vue 3 package for mono integration.
### Install
```
// with npm
npm i @damilaredev/vue-mono --save
//with yarn
yarn add @damilaredev/vue-mono
//with pnpm
pnpm add @damilaredev/vue-mono
```
### Usage
```
import { createApp } from 'vue';
import App from './App.vue'
import VueMono from '@damilaredev/vue-mono';
const app = createApp(App)
app.use(VueMono)
app.mount('#app')
```
###### example
```vue
import { ref } from 'vue';
import type { Ref } from 'vue'
const publicKey: Ref<string> = ref<string>('xxxxxxxxxxxxxxxxxxxxxxx');
const success = (response: string): void => console.log(response);
Connect With Mono
```
###### or referencing the component instance data
```vue
import { ref, unref } from 'vue';
import { MonoComponent } from '@damilaredev/vue-mono';
import type {Ref, ComponentPublicInstance } from 'vue'
import type { MonoPropType } from '@damilaredev/vue-mono';
const publicKey: Ref<string> = ref<string>('xxxxxxxxxxxxxxxxxxxxxxx');
const monoRef: Ref<ComponentPublicInstance<Record<string, unknown>, MonoPropType> | null> = ref(null);
const connect = (): void => unref(monoRef)!.connectWithMono();
const success = (response: string): void => console.log(response);
Connect With Mono
```