03 2025 档案

摘要:import router from '@ohos.router'import { Choice } from '../view/ChoicePage';import { Home } from '../view/HomePage';import { Mine } from '../view/Min 阅读全文
posted @ 2025-03-29 16:58 13522679763-任国强 阅读(13) 评论(0) 推荐(0)
摘要:import router from '@ohos.router'import Prompt from '@system.prompt'import promptAction from '@ohos.promptAction'@Entry@Componentstruct Login { @State 阅读全文
posted @ 2025-03-29 16:57 13522679763-任国强 阅读(11) 评论(0) 推荐(0)
摘要:import { Home } from '../view/Home'import { Product } from '../view/Product'import { Cart } from '../view/Cart'import { Personal } from '../view/Perso 阅读全文
posted @ 2025-03-26 10:41 13522679763-任国强 阅读(11) 评论(0) 推荐(0)
摘要:import router from '@ohos.router'@Preview@Entry@Componentstruct Page12_GuidePage { @State message: string = 'Hello World' @State count:number = 3 priv 阅读全文
posted @ 2025-03-25 17:26 13522679763-任国强 阅读(7) 评论(0) 推荐(0)
摘要:import { StorageChildren } from '../view/StorageChildren'let storage:LocalStorage = new LocalStorage("username")storage.setOrCreate('username','小王')@E 阅读全文
posted @ 2025-03-24 11:02 13522679763-任国强 阅读(13) 评论(0) 推荐(0)
摘要:初始页面给默认配置 PersistentStorage.PersistProp('token','') import router from '@ohos.router' import { login, sendCode } from '../http/Api' @Entry @Component 阅读全文
posted @ 2025-03-24 09:44 13522679763-任国强 阅读(10) 评论(0) 推荐(0)
摘要:import axios, { AxiosError, AxiosResponse, InternalAxiosRequestConfig } from '@ohos/axios' import promptAction from '@ohos.promptAction'; //创建axios实例 阅读全文
posted @ 2025-03-24 09:41 13522679763-任国强 阅读(14) 评论(0) 推荐(0)
摘要:import { getRandomName, getRandomPhone } from '../../../../utils/RandomUtil';import { Person } from './model/DataModel';@Entry@Componentstruct Contact 阅读全文
posted @ 2025-03-16 14:49 13522679763-任国强 阅读(11) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2025-03-16 13:42 13522679763-任国强 阅读(10) 评论(0) 推荐(0)
摘要:@Entry@Componentstruct GrandParent { @Provide count: number = 1; build() { Column() { Column({ space: 10 }) { //祖先组件标题 Text('祖先组件').textStyle() //祖先组件 阅读全文
posted @ 2025-03-16 13:27 13522679763-任国强 阅读(10) 评论(0) 推荐(0)
摘要:@Entry@Componentstruct Parent { @State count: number = 1; inc = () => { this.count++ } dec = () => { this.count-- } build() { Column() { Column({ spac 阅读全文
posted @ 2025-03-16 13:23 13522679763-任国强 阅读(9) 评论(0) 推荐(0)
摘要:@Entry@Componentstruct Parent { @State count: number = 1; build() { Column() { Column({ space: 10 }) { //父组件标题 Text('父组件').textStyle() //父组件计数器 Row({ 阅读全文
posted @ 2025-03-16 13:22 13522679763-任国强 阅读(11) 评论(0) 推荐(0)
摘要:@Entry@Componentstruct ScrollerPage { data: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] scroller:Scroller = new Scroller() build() 阅读全文
posted @ 2025-03-16 00:10 13522679763-任国强 阅读(16) 评论(0) 推荐(0)
摘要:@Entry@Componentstruct CalculatorPage { build() { Column() { Grid(){ GridItem(){ Text('0').screenTextStyle() }.columnStart(1).columnEnd(6) GridItem(){ 阅读全文
posted @ 2025-03-15 23:54 13522679763-任国强 阅读(27) 评论(0) 推荐(0)
摘要:@Entry@Componentstruct StartAndEndPage { build() { Column() { Grid() { GridItem() { Text('1') .itemTextStyle() }.rowStart(0).rowEnd(1).columnStart(0). 阅读全文
posted @ 2025-03-15 23:41 13522679763-任国强 阅读(12) 评论(0) 推荐(0)
摘要:@Entry@Componentstruct BuilderParamPage { build() { Column({ space: 50 }) { //创建卡片组件(传参) Card({ content: imageBuilder }) //创建卡片组件("子组件") Card() { Colu 阅读全文
posted @ 2025-03-15 17:15 13522679763-任国强 阅读(11) 评论(0) 推荐(0)
摘要:@Entry@Componentstruct DifferencePage { build() { Column({ space: 10 }) { Text('待办事项') .fontSize(30) .fontWeight(FontWeight.Bold) .width('100%') TodoI 阅读全文
posted @ 2025-03-15 17:08 13522679763-任国强 阅读(11) 评论(0) 推荐(0)
摘要:@Entry@Componentstruct BuilderPage { // 组建内的 @Builder compButtonBuilder(icon:Resource,text:string,callback:()=>void){ Button() { Row({ space: 10 }) { 阅读全文
posted @ 2025-03-15 17:02 13522679763-任国强 阅读(14) 评论(0) 推荐(0)
摘要:@Entry@Componentstruct DatePickerDialogPage { @State date: Date = new Date("2010-1-1"); build() { Column({ space: 50 }) { Text(`${this.date.getFullYea 阅读全文
posted @ 2025-03-15 16:25 13522679763-任国强 阅读(10) 评论(0) 推荐(0)
摘要:@Entry@Componentstruct TextPickerDialogPage { fruits: string[] = ['苹果', '橘子', '香蕉', '鸭梨', '西瓜'] @State selectedIndex: number = 0 build() { Column({ sp 阅读全文
posted @ 2025-03-15 16:24 13522679763-任国强 阅读(11) 评论(0) 推荐(0)
摘要:@Entry@Componentstruct TimePickerDialogPage { @State time: Date = new Date('2020-01-01T00:00:00') build() { Column({ space: 50 }) { Text(`${this.time. 阅读全文
posted @ 2025-03-15 16:22 13522679763-任国强 阅读(7) 评论(0) 推荐(0)
摘要:@Entry@Componentstruct AlertDialogPage { build() { Column() { Button('删除') .backgroundColor(Color.Red) .onClick(() => { AlertDialog.show( { title: '删除 阅读全文
posted @ 2025-03-15 16:19 13522679763-任国强 阅读(25) 评论(0) 推荐(0)
摘要:@Entry@Componentstruct CustomDialogPage { @State answer: string = '?' // controller: CustomDialogController = new CustomDialogController({ // builder: 阅读全文
posted @ 2025-03-15 13:24 13522679763-任国强 阅读(9) 评论(0) 推荐(0)
摘要:import { TaskItem } from '../view/TaskItem'import { TaskStatisties } from '../view/TaskStatisties'@Entry@Componentstruct TaskList { @State message: st 阅读全文
posted @ 2025-03-14 16:53 13522679763-任国强 阅读(20) 评论(0) 推荐(0)
摘要:@Entry@Componentstruct StackPage { @State message: string = 'Hello World' build() { Column() { Stack({alignContent:Alignment.TopStart}){ Column(){ }.w 阅读全文
posted @ 2025-03-14 16:51 13522679763-任国强 阅读(10) 评论(0) 推荐(0)
摘要:@Entry@Componentstruct Page05_RelativeContainer { @State message: string = 'Hello World' build() { // RelativeContainer() { // Column(){ // Text('text 阅读全文
posted @ 2025-03-14 16:50 13522679763-任国强 阅读(13) 评论(0) 推荐(0)
摘要:// 内部公共样式@Styles function titleText2(){ .width(100).height(100).backgroundColor(Color.Red).borderRadius(10)}// 定义 Text 组件的扩展样式@Extend(Text) function t 阅读全文
posted @ 2025-03-14 16:49 13522679763-任国强 阅读(15) 评论(0) 推荐(0)