mirror of https://github.com/sunface/rust-course
parent
594f806d59
commit
891462a346
@ -1,4 +1,5 @@
|
|||||||
const enUS = {
|
import {localeData} from './index'
|
||||||
|
const enUS:localeData = {
|
||||||
home: 'Home',
|
home: 'Home',
|
||||||
dashboard: 'Dashboard',
|
dashboard: 'Dashboard',
|
||||||
chart: 'Chart',
|
chart: 'Chart',
|
@ -1,8 +0,0 @@
|
|||||||
|
|
||||||
import zhCN from '@library/locale/zh_CN' // 中文
|
|
||||||
import enUS from '@library/locale/en_US' // 英文
|
|
||||||
|
|
||||||
export default {
|
|
||||||
'en': enUS,
|
|
||||||
'zh': zhCN
|
|
||||||
}
|
|
@ -0,0 +1,17 @@
|
|||||||
|
|
||||||
|
import zhCN from './zh_CN' // 中文
|
||||||
|
import enUS from './en_US' // 英文
|
||||||
|
|
||||||
|
export type localeData = {
|
||||||
|
[key:string]:string
|
||||||
|
}
|
||||||
|
|
||||||
|
type localeAll = {
|
||||||
|
[key:string]:localeData
|
||||||
|
}
|
||||||
|
|
||||||
|
const localeAllData:localeAll = {
|
||||||
|
'en': enUS,
|
||||||
|
'zh': zhCN
|
||||||
|
}
|
||||||
|
export default localeAllData
|
@ -1,4 +1,5 @@
|
|||||||
const zhCN = {
|
import {localeData} from './index'
|
||||||
|
const zhCN:localeData = {
|
||||||
home: '主页',
|
home: '主页',
|
||||||
dashboard: '仪表盘',
|
dashboard: '仪表盘',
|
||||||
chart: '图表',
|
chart: '图表',
|
@ -1,10 +1,17 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import Element from '@library/routes/modules/Element'
|
import Element from '../routes/modules/Element'
|
||||||
|
|
||||||
const Dashboard = React.lazy(() => import('@pages/Index/Dashboard'))
|
const Dashboard = React.lazy(() => import('../../pages/Index/Dashboard'))
|
||||||
const Charts = React.lazy(() => import('@pages/Index/Charts'))
|
const Charts = React.lazy(() => import('../../pages/Index/Charts'))
|
||||||
|
|
||||||
const Routers = [
|
export type Router = {
|
||||||
|
path: string,
|
||||||
|
title: string,
|
||||||
|
icon: string,
|
||||||
|
component?: any,
|
||||||
|
children?:any
|
||||||
|
}
|
||||||
|
const Routers:Router[] = [
|
||||||
{
|
{
|
||||||
path: '/home/dashboard',
|
path: '/home/dashboard',
|
||||||
title: 'dashboard',
|
title: 'dashboard',
|
@ -1,6 +1,6 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
const A = React.lazy(() => import('@pages/Index/Demo/A'))
|
const A = React.lazy(() => import('../../../pages/Index/Demo/A'))
|
||||||
const B = React.lazy(() => import('@pages/Index/Demo/B'))
|
const B = React.lazy(() => import('../../../pages/Index/Demo/B'))
|
||||||
|
|
||||||
const Demo = [
|
const Demo = [
|
||||||
{
|
{
|
@ -1,9 +1,9 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
const Accordion = React.lazy(() => import('@pages/Index/Elements/Accordion'))
|
const Accordion = React.lazy(() => import('../../../pages/Index/Elements/Accordion'))
|
||||||
const Paginations = React.lazy(() => import('@pages/Index/Elements/Paginations'))
|
const Paginations = React.lazy(() => import('../../../pages/Index/Elements/Paginations'))
|
||||||
const DatePickers = React.lazy(() => import('@pages/Index/Elements/DatePickers'))
|
const DatePickers = React.lazy(() => import('../../../pages/Index/Elements/DatePickers'))
|
||||||
const Icons = React.lazy(() => import('@pages/Index/Elements/Icons'))
|
const Icons = React.lazy(() => import('../../../pages/Index/Elements/Icons'))
|
||||||
|
|
||||||
const Demo = [
|
const Demo = [
|
||||||
{
|
{
|
@ -1,13 +1,13 @@
|
|||||||
let adminKey = 'admin-'
|
let adminKey = 'admin-'
|
||||||
const storage = {
|
const storage = {
|
||||||
set(key, value){
|
set(key:string, value:any){
|
||||||
localStorage.setItem(adminKey+key, JSON.stringify(value))
|
localStorage.setItem(adminKey+key, JSON.stringify(value))
|
||||||
},
|
},
|
||||||
get(key){
|
get(key:string){
|
||||||
return JSON.parse(localStorage.getItem(adminKey+key))
|
return JSON.parse(localStorage.getItem(adminKey+key)!)
|
||||||
},
|
},
|
||||||
remove(key){
|
remove(key:string){
|
||||||
localStorage.removeItem(adminKey+key)
|
localStorage.removeItem(adminKey+key)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export default storage
|
export default storage
|
@ -1,6 +1,6 @@
|
|||||||
import {Light, Dark} from '@styles/theme'
|
import {Light, Dark} from '../../styles/theme'
|
||||||
|
|
||||||
export function modifyVars(model, primary){
|
export function modifyVars(model:boolean, primary:string){
|
||||||
//window.less.modifyVars(vars)
|
//window.less.modifyVars(vars)
|
||||||
if(model){
|
if(model){
|
||||||
window.less.modifyVars(Dark(primary))
|
window.less.modifyVars(Dark(primary))
|
@ -1 +1,6 @@
|
|||||||
declare module '*.less'
|
declare module '*.less'
|
||||||
|
|
||||||
|
|
||||||
|
declare interface Window {
|
||||||
|
less: any;
|
||||||
|
}
|
||||||
|
Loading…
Reference in new issue