@bagelink/sdk
TypeScript icon, indicating that this package has built-in type declarations

0.0.435 • Public • Published

@bagelink/vue

Features:

Usage

Use component globally

// src/main.ts
import { createApp } from 'vue';
import { BagelVue } from '@bagel/vue';

import App from './App.vue';

const BagelConfig = {
  host: import.meta.env.VITE_BASE_URL,
  // eslint-disable-next-line n/handle-callback-err
  onError: (err: any) => {
    // handle error
    // example:
    // useToast().error(`${$t('anErrorOccurred')}: ${err?.response?.data?.detail || err.message}`);
  },
};

const app = createApp(App);
app.use(head as Plugin);

app.mount('#app');

Import component

<script setup lang="ts">
import { useBagel } from '@bagel/vue';

const bagel = useBagel();
</script>

<!-- OR -->
<script lang="ts">
export default defineComponent({
  onMounted() {
    console.log(this.$bagel.host)
  },
});
</script>

<!-- OR -->
<template>
	<div>
		{{ $bagel.host }}
	</div>
</template>

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i @bagelink/sdk

Weekly Downloads

70

Version

0.0.435

License

MIT

Unpacked Size

71 kB

Total Files

14

Last publish

Collaborators

  • natiyoung
  • natanelyoung
  • nallon