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

0.0.437 • 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/vue

Weekly Downloads

61

Version

0.0.437

License

MIT

Unpacked Size

4.39 MB

Total Files

320

Last publish

Collaborators

  • natiyoung
  • natanelyoung
  • nallon