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

浙公网安备 33010602011771号