1234567891011121314151617181920212223242526272829303132333435 |
- import {defineStore} from "pinia";
- import titleLogo from '@/assets/images/web/web-home_title.png'
- import webBgImg from '@/assets/images/web/web-home_bg.png'
- import loginImg from '@/assets/images/global/login-img.png'
- export const useThemeStore = defineStore('theme', {
- state: () => ({
- init: false,
- title: '智慧搜索平台',
- subTitle: '',
- logo: '',
- titleLogo: '',
- webBgImg: webBgImg,
- loginImg: loginImg,
- }),
- getters: {
- },
- actions: {
- setTheme(config) {
- this.init = true
- const setValue = (key1, key2) => {
- if (config[key2]) {
- this[key1] = config[key2]
- }
- }
- setValue('title', 'title')
- setValue('subTitle', 'subTitle')
- setValue('logo', 'logo')
- setValue('titleLogo', 'titleLogo')
- setValue('webBgImg', 'webBgImg')
- setValue('loginImg', 'loginImg')
- }
- },
- })
|