当前位置: 首页 > news >正文

wordpress 启动流程优化问题

wordpress 启动流程,优化问题,潢川微信网站建设,阿里云轻量应用服务器wordpress视频课程: 东西比较多, 这里主要分享一些代码和案例. 开关灯效果案例: 开灯 开关灯效果案例: 关灯 Column 和 Row 的基本用法 Entry Component struct Index {State message: string 张三;build() {// 一行内容Row() {// 一列内容Column() {// 文本内容Text(this.mess…

视频课程:
在这里插入图片描述

东西比较多, 这里主要分享一些代码和案例.

开关灯效果案例: 开灯
在这里插入图片描述

开关灯效果案例: 关灯
在这里插入图片描述

Column 和 Row 的基本用法

@Entry
@Component
struct Index {@State message: string = '张三';build() {// 一行内容Row() {// 一列内容Column() {// 文本内容Text(this.message).fontSize(50)// 字体大小.fontWeight(FontWeight.Bold) // 字体粗细}.width("100%")}.height('100%')}
}

一行两列的布局

@Entry
@Component
struct Index {@State message: string = '张三';build() {// 一行内容Row() {// 一列内容Column() {// 文本内容Text(this.message).fontSize(50)// 字体大小.fontWeight(FontWeight.Bold) // 字体粗细}.width("50%")// 一列内容Column() {// 文本内容Text(this.message).fontSize(50)// 字体大小.fontWeight(FontWeight.Bold) // 字体粗细}.width("50%")}.height('100%')}
}

开关灯效果案例的基本实现

@Entry
@Component
struct Index {@State isOn: boolean = falsebuild() {Column({space: 10}) {if (this.isOn) {Image("pages/images/img_light.png").width(300).height(300)} else {Image("pages/images/img_dark.png").width(300).height(300)}Row({space: 30}) {Button("开灯").onClick(() => this.isOn = true)Button("关灯").onClick(() => this.isOn = false)}}.width("100%").height("100%").justifyContent(FlexAlign.Center)}
}

图标按钮案例

@Entry
@Component
struct Index {@State isOn: boolean = falsebuild() {Column() {Button(){Image("pages/images/ic_delete.png").width(25).height(25)}.width(50).height(50).type(ButtonType.Circle).backgroundColor(Color.Red).onClick(()=>console.log("删除成功"))}.width("100%").height("100%").justifyContent(FlexAlign.Center)}
}

自定义组件案例

@Entry
@Component
struct Index {@State isOn: boolean = falsebuild() {Column({ space: 10 }) {if (this.isOn) {Image("pages/images/img_light.png").width(300).height(300).borderRadius(20)} else {Image("pages/images/img_dark.png").width(300).height(300).borderRadius(20)}Row({ space: 30 }) {GreenButton().onClick(() => this.isOn = true)RedButton().onClick(() => this.isOn = false)}}.width("100%").height("100%").justifyContent(FlexAlign.Center)}
}@Component
struct RedButton {build() {Button({ type: ButtonType.Circle }) {Image("pages/images/icon_switch.png").width(25).height(25)}.width(50).height(50).backgroundColor(Color.Red)}
}@Component
struct GreenButton {build() {Button({ type: ButtonType.Circle }) {Image("pages/images/icon_switch.png").width(25).height(25)}.width(50).height(50).backgroundColor(Color.Green)}
}

自定义组件参数案例

@Entry
@Component
struct Index {@State isOn: boolean = falsebuild() {Column({ space: 10 }) {if (this.isOn) {Image("pages/images/img_light.png").width(300).height(300).borderRadius(20)} else {Image("pages/images/img_dark.png").width(300).height(300).borderRadius(20)}Row({ space: 30 }) {SwitchButton({ color: Color.Green }).onClick(() => this.isOn = true)SwitchButton().onClick(() => this.isOn = false)}}.width("100%").height("100%").justifyContent(FlexAlign.Center)}
}@Component
struct SwitchButton {color: Color = Color.Redbuild() {Button({ type: ButtonType.Circle }) {Image("pages/images/icon_switch.png").width(25).height(25)}.width(50).height(50).backgroundColor(this.color)}
}

组件文件案例

index.ets

import { SwitchButton } from './SwitchButton'@Entry
@Component
struct Index {@State isOn: boolean = falsebuild() {Column({ space: 10 }) {if (this.isOn) {Image("pages/images/img_light.png").width(300).height(300).borderRadius(20)} else {Image("pages/images/img_dark.png").width(300).height(300).borderRadius(20)}Row({ space: 30 }) {SwitchButton({ color: Color.Green }).onClick(() => this.isOn = true)SwitchButton().onClick(() => this.isOn = false)}}.width("100%").height("100%").justifyContent(FlexAlign.Center)}
}

SwitchButton.ets

@Component
export struct SwitchButton {color: Color = Color.Redbuild() {Button({ type: ButtonType.Circle }) {Image("pages/images/icon_switch.png").width(25).height(25)}.width(50).height(50).backgroundColor(this.color)}
}
http://www.yidumall.com/news/60556.html

相关文章:

  • 公司网站高端网站建设2023年8月疫情又开始了吗
  • 北京市网站制作设计长沙新媒体营销
  • 深圳做网站网络公司有哪些电商代运营十大公司排名
  • 成都创意网站设计官网首页入口百度
  • 一级域名网站抖音怎么推广
  • 网站主体负责人不是法人买转发链接
  • 网站 带后台网站搭建平台都有哪些
  • 如何做京东购物网站设计网站推荐
  • 做网站怎么调用栏目站长工具seo
  • 网站建设教学方法探究百度手机
  • 如何用书签 做网站接口百度账号中心
  • 在线设计装修的网站国家市场监督管理总局官网
  • 有没有学做蛋糕的网站和视频新手怎么推广自己的店铺
  • 网站开发产品设计公司给你一个网站怎么优化
  • wordpress建站动画引流推广公司
  • 微信下滑小程序怎么关北京seo排名厂家
  • 西安商城网站seo优化服务是什么意思
  • 石家庄网站建设行业公司百度怎么发布自己的广告
  • 网页美工设计培训学校网站seo检测工具
  • vs2017网站开发教程seo入门教学
  • 哈尔滨网站制作哪家好薇百度竞价关键词出价技巧
  • 西宁网站建设公司哪家好深圳创新创业大赛
  • 成全视频免费观看在线看游戏长沙seo运营
  • 域名注册的网站都有哪些三一crm手机客户端下载
  • wordpress会员点数sem优化怎么做
  • wordpress视频教程杭州seo渠道排名
  • 赣州那里有做网站的公司项目推广计划书
  • 怎么做直播网站做关键词优化的公司
  • 大连做网站的公司有哪些你就知道首页
  • 政府部门做网站山东济南seo整站优化公司