Skip to content

Commit

Permalink
fix: move the pinia instance to Tido function for local usage
Browse files Browse the repository at this point in the history
  • Loading branch information
paulpestov committed Aug 21, 2024
1 parent d209429 commit 8861fa2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createApp, h } from 'vue';
import PrimeVue from 'primevue/config';
import { createPinia } from 'pinia'
import { createPinia } from 'pinia';
import { i18n } from './i18n';
import App from './App.vue';

Expand All @@ -12,13 +12,14 @@ import { getRGBColor } from '@/utils/color';
import { useToggle } from '@vueuse/core/index';
import { isDark } from '@/utils/is-dark';

const pinia = createPinia()

function generateId() {
return Math.random().toString(36).slice(2, 16);
}

window.Tido = function Tido(config = {}) {
const pinia = createPinia();

this.config = { ...config };

this.app = createApp({
Expand Down

0 comments on commit 8861fa2

Please sign in to comment.