已开启
修改[使用T[]而非Array<T>] #7
easy_ghf创建于 7月23日
修改[使用T[]而非Array<T>] #7
已开启
共 3 个文件变更+3-3
| @@ -29,7 +29,7 @@ export class CommonConstants { | |||
| 29 | public static readonly KEY_PREFIX: string = 'preference'; | 29 | public static readonly KEY_PREFIX: string = 'preference'; |
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | -export const THEMES: Array<ImageAndName>[] = [ | 32 | +export const THEMES: ImageAndName[][] = [ |
| 33 | [ | 33 | [ |
| 34 | { image: $r('sys.symbol.phone'), name: $r('app.string.dialer'), color: $r('sys.color.font_primary') }, | 34 | { image: $r('sys.symbol.phone'), name: $r('app.string.dialer'), color: $r('sys.color.font_primary') }, |
| 35 | { image: $r('sys.symbol.bag_badge_plus'), name: $r('app.string.shopping'), color: $r('sys.color.font_primary') }, | 35 | { image: $r('sys.symbol.bag_badge_plus'), name: $r('app.string.shopping'), color: $r('sys.color.font_primary') }, |
| @@ -28,7 +28,7 @@ let preferenceTheme: preferences.Preferences | null = null; | |||
| 28 | @Component | 28 | @Component |
| 29 | export struct PreferencesComponent { | 29 | export struct PreferencesComponent { |
| 30 | @State nowTheme: string = ''; | 30 | @State nowTheme: string = ''; |
| 31 | - @State themeDatas: Array<ImageAndName> = []; | 31 | + @State themeDatas: ImageAndName[] = []; |
| 32 | @StorageProp(CommonConstants.KEY_PREFIX + 'Breakpoint') currentBreakpoint: string = 'sm'; | 32 | @StorageProp(CommonConstants.KEY_PREFIX + 'Breakpoint') currentBreakpoint: string = 'sm'; |
| 33 | @StorageProp(CommonConstants.KEY_PREFIX + 'StatusBarHeight') topRectHeight: number = 0; | 33 | @StorageProp(CommonConstants.KEY_PREFIX + 'StatusBarHeight') topRectHeight: number = 0; |
| 34 | 34 | ||
| @@ -18,7 +18,7 @@ import { BreakpointType } from '../utils/BreakpointSystem'; | |||
| 18 | 18 | ||
| 19 | @Component | 19 | @Component |
| 20 | export default struct ThemeDesktop { | 20 | export default struct ThemeDesktop { |
| 21 | - @Link themeDatas: Array<ImageAndName>; | 21 | + @Link themeDatas: ImageAndName[]; |
| 22 | @StorageProp(CommonConstants.KEY_PREFIX + 'Breakpoint') curBp: string = 'sm'; | 22 | @StorageProp(CommonConstants.KEY_PREFIX + 'Breakpoint') curBp: string = 'sm'; |
| 23 | 23 | ||
| 24 | build() { | 24 | build() { |