mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-06-09 09:57:19 +08:00
14 lines
374 B
JavaScript
14 lines
374 B
JavaScript
import serialized from '@siteData';
|
|
import { ref, readonly } from 'vue';
|
|
const parse = (data) => readonly(JSON.parse(data));
|
|
export const siteDataRef = ref(parse(serialized));
|
|
export function useSiteData() {
|
|
return siteDataRef;
|
|
}
|
|
// hmr
|
|
if (import.meta.hot) {
|
|
import.meta.hot.acceptDeps('/@siteData', (m) => {
|
|
siteDataRef.value = parse(m.default);
|
|
});
|
|
}
|