refactor code to nuxt and add ssr and edit some text in landing
This commit is contained in:
+17
-11
@@ -1,16 +1,22 @@
|
||||
import {ref} from 'vue'
|
||||
import {defineStore} from 'pinia'
|
||||
import { ref } from 'vue'
|
||||
import { defineStore } from 'pinia'
|
||||
import { getTenantConfig } from '@/config/app-config'
|
||||
|
||||
export const useConfigStore = defineStore('config', () => {
|
||||
const config = ref(window.__APP_CONFIG__?.user)
|
||||
const config = ref<Record<string, any> | null>(null)
|
||||
|
||||
async function getConfigData() {
|
||||
config.value = window.__APP_CONFIG__?.user
|
||||
console.log(config.value)
|
||||
}
|
||||
function hydrateFromAppConfig() {
|
||||
const tenant = getTenantConfig()
|
||||
config.value = tenant && Object.keys(tenant).length > 0 ? tenant : null
|
||||
}
|
||||
|
||||
return {
|
||||
config,
|
||||
getConfigData
|
||||
}
|
||||
async function getConfigData() {
|
||||
hydrateFromAppConfig()
|
||||
}
|
||||
|
||||
return {
|
||||
config,
|
||||
hydrateFromAppConfig,
|
||||
getConfigData,
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user