how to import pinia state into an external config file? #560
Answered
by
posva
Fanna1119
asked this question in
Help and Questions
-
I have a pinia store state that i would like to import into a tailwind config file. i get the following error:
//pinia store import { defineStore } from 'pinia'
import { useStorage } from '@vueuse/core'
export const useThemes = defineStore({
id: 'themeSelect',
state: () => (
{
ActiveTheme: useStorage("active-theme", "emerald"),
availableThemes: ['emerald', 'dark', 'forest', 'synthwave']
}
) windi.config.js const { transform } = require('windicss/helpers')
import { useThemes } from './src/stores/themeSelect.js'
const mythemes = useThemes();
module.exports = {
plugins: [
transform('daisyui'),
],
daisyui: {
themes: Object.values(mythemes.availableThemes)
}
} |
Beta Was this translation helpful? Give feedback.
Answered by
posva
Jul 4, 2021
Replies: 1 comment
-
You need to pass the pinia instance but you won't be able to share it with your app because your application runs in a different context (the browser) than the dev server (mode process) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
posva
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need to pass the pinia instance but you won't be able to share it with your app because your application runs in a different context (the browser) than the dev server (mode process)