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

Apache Wordpress伪静态处理网站关键词优化建议

Apache Wordpress伪静态处理,网站关键词优化建议,网页模板dw,网站建设需要具备的能力目录 装饰器Entry(入口)Component(组件)State(状态)Preview(预览)PreviewerInspector 结构体structbuild自定义组件自定义 Custom 组件 容器Row(行) & Column(列)RelativeContainer(相对布局容器)marginpaddingGrid(网格容器)List(列表) 组件Image(图片)图片的填充模式 Tex…

目录

  • 装饰器
    • @Entry(入口)
    • @Component(组件)
    • @State(状态)
    • @Preview(预览)
      • Previewer
      • Inspector
  • 结构体
    • struct
    • build
    • 自定义组件
      • 自定义 Custom 组件
  • 容器
    • Row(行) & Column(列)
    • RelativeContainer(相对布局容器)
    • margin
    • padding
    • Grid(网格容器)
    • List(列表)
  • 组件
    • Image(图片)
      • 图片的填充模式
    • Text(文本)
      • 组件:左上角对齐
      • 文字:左对齐
    • Swiper(轮播图)
  • 参考

装饰器

@Entry(入口)

@Entry 装饰的 @Component 将作为 UI 页面的入口
在单个 UI 页面中,最多可以使用@Entry 装饰一个自定义组件

@Entry
@Component
struct Index {}

@Component(组件)

@Component 装饰了 struct 关键字声明的数据结构 Index
Index 被 @Component 装饰后具备组件化的能力,通过实现 build 方法描述 UI

@Component
struct Index {build() {}
}

@State(状态)

文本信息由 @State 装饰器装饰的状态变量 message 驱动

@State message: string = 'HarmonyOS 速记';

@Preview(预览)

Previewer

  • Previewer 可以直接预览 @Entry 装饰的整个页面
    也可以预览由 @Preview 装饰的单独组件
  • 预览 @Entry 装饰的整个页面时,需要选中 @Entry 所在的文件,Previewer 才能顺利打开
  • 将 Previewer 调整至 ComponentMode,便可以单独预览组件视图
  • 如果修改的是文本内容,则需要手动保存(即 ctrl+s)后,Previewer 才会更新
    如果修改的是相关属性,则不需要手动保存,Previewer 也会实时更新
  • 注意:此时的 Inspector 是不可用状态

Inspector

开启 Previewer 工具栏的 Inspector 工具,可以观察到当前组件树,并与 Previewer 交互

结构体

struct

定义结构体,即数据结构

struct Index {}

build

build 方法用于描述 UI

 build() {}

自定义组件

@Component
struct Custom {build() {}
}

自定义 Custom 组件

@Preview // 用于组件预览
@Component // 定义组件
struct Custom { // 组件名build() {Image($r('app.media.banner_pic1')) // 图片.width('100%') // 宽度.padding({ // 内边距left: 16,top: 10,right: 16,bottom: 10}).borderRadius(16) // 圆角.objectFit(ImageFit.Contain) // 缩放模式}
}

容器

Row(行) & Column(列)

    Row() {Column() {Text(this.message).fontSize(20).fontWeight(FontWeight.Bold)}.width('100%')}.height('100%')

RelativeContainer(相对布局容器)

alignRules 在 RelativeContainer 中设置对齐规则(位置:上中下、左中右)

  • top、center、bottom 上中下
  • left、middle、right 左中右

注:alignRules 属性在 Row & Column 容器中无效

	// 水平、竖直居中RelativeContainer() {Text(this.message).fontSize(20).fontWeight(FontWeight.Bold).alignRules({ // 对齐规则center: {anchor: '__container__',align: VerticalAlign.Center},middle: {anchor: '__container__',align: HorizontalAlign.Center}})}.width('100%').height('100%')

正常效果:Start -> Top/Center/Bottom

异常效果:Start -> Top/Center/Bottom

正常效果:Top -> Start/Middle/End

异常效果:Top -> Start/Middle/End

函数 alignRules 声明

alignRules(value: AlignRuleOption): T;

参数 AlignRuleOption 源码

declare interface AlignRuleOption {top?: { // 上anchor: string;align: VerticalAlign;};center?: { // 中anchor: string;align: VerticalAlign;};bottom?: { // 下anchor: string;align: VerticalAlign;};left?: { // 左anchor: string;align: HorizontalAlign;};middle?: { // 中anchor: string;align: HorizontalAlign;};right?: { // 右anchor: string;align: HorizontalAlign;};bias?: Bias;
}

结论

top、center、bottom、left、middle、right

  • 对应着 设置子控件的基线,即以子控件的哪个位置作为对齐的基准点

VerticalAlign#Top、Center、Bottom & HorizontalAlign#Start、Center、End

  • 这些属性才是对应着 设置子控件相对于父布局的对齐规则,但需要配合上面的使用才会得到想要的正确效果

margin

外边距

      Text(this.message).margin({left: 20,top: 20,right: 20,bottom: 20})

padding

内边距

      Text(this.message).padding({left: 20,top: 20,right: 20,bottom: 20})

Grid(网格容器)

网格容器,由“行”和“列”分割的单元格所组成,其中容器内各条目对应一个 GridItem 组件
如果仅设置行、列数量与占比中的一个,则网格单元将按照设置的方向排列,超出Grid显示区域后,Grid拥有可滚动能力
设置单行显示,则赋能套件部分可以横向滑动

List(列表)

List容器可以轻松高效地显示结构化、可滚动的信息。当列表项达到一定数量,内容超过屏幕大小时,可以自动提供滚动功能

组件

Image(图片)

用于显示图片,使用 $r(‘app.media. 文件名字’) 将 media 文件夹下的图片读取到 Image 组件

    Image($r('app.media.banner_pic1')) // 设置图片资源.width('100%') // 宽度.padding({ // 内边距left: 16,top: 10,right: 16,bottom: 10}).borderRadius(16) // 圆角.objectFit(ImageFit.Contain) // 缩放模式

图片的填充模式

.objectFit(ImageFit.Contain)

设置图片的填充模式

  • Contain 模式,即保持宽高比进行缩小或者放大,使得图片完全显示在显示边界内

Text(文本)

组件:左上角对齐

      Text(this.message) // 默认宽度 wrap_content.id('HelloWorld').fontSize(20).fontWeight(FontWeight.Bold).fontStyle(FontStyle.Italic).lineHeight(55).alignRules({ // 对齐规则:左上角(top、left) 为 对其基准点top: { // 上边缘 为 对其基准点anchor: '__container__',align: VerticalAlign.Top // 上对齐},left: { // 左边缘 为 对其基准点anchor: '__container__',align: HorizontalAlign.Start // 左对齐}})

文字:左对齐

      Text(this.message).width('100%') // 设置宽度 match_parent.textAlign(TextAlign.Start) // 设置文字朝向 居左

Swiper(轮播图)

使用Swiper构建轮播图

参考

HarmonyOS应用开发快速入门


文章转载自:
http://xylograph.c7622.cn
http://lyric.c7622.cn
http://exonym.c7622.cn
http://microsporidian.c7622.cn
http://plastering.c7622.cn
http://jihad.c7622.cn
http://moral.c7622.cn
http://effigy.c7622.cn
http://panmictic.c7622.cn
http://saltatory.c7622.cn
http://tastemaker.c7622.cn
http://epsilon.c7622.cn
http://guessable.c7622.cn
http://seigniory.c7622.cn
http://canzonet.c7622.cn
http://quassia.c7622.cn
http://colobus.c7622.cn
http://taxable.c7622.cn
http://osteal.c7622.cn
http://syringe.c7622.cn
http://ganoid.c7622.cn
http://heeltap.c7622.cn
http://onomancy.c7622.cn
http://nonaggression.c7622.cn
http://brasier.c7622.cn
http://moorish.c7622.cn
http://mediatorial.c7622.cn
http://founder.c7622.cn
http://blinkard.c7622.cn
http://coriaceous.c7622.cn
http://fortitude.c7622.cn
http://lacquerware.c7622.cn
http://crum.c7622.cn
http://muley.c7622.cn
http://kakinada.c7622.cn
http://plausibility.c7622.cn
http://melting.c7622.cn
http://petto.c7622.cn
http://pitted.c7622.cn
http://liberalism.c7622.cn
http://electricize.c7622.cn
http://godless.c7622.cn
http://sharpie.c7622.cn
http://lempert.c7622.cn
http://autonomous.c7622.cn
http://christophany.c7622.cn
http://europe.c7622.cn
http://cordelle.c7622.cn
http://autolyze.c7622.cn
http://ses.c7622.cn
http://depeople.c7622.cn
http://hogly.c7622.cn
http://villiform.c7622.cn
http://sympathin.c7622.cn
http://luminesce.c7622.cn
http://discontinuousness.c7622.cn
http://thermocurrent.c7622.cn
http://chigetai.c7622.cn
http://pronucleus.c7622.cn
http://latifundist.c7622.cn
http://trout.c7622.cn
http://bhamo.c7622.cn
http://superjacent.c7622.cn
http://stalagmitic.c7622.cn
http://antimicrobial.c7622.cn
http://diphenylacetylene.c7622.cn
http://lacertilian.c7622.cn
http://forbore.c7622.cn
http://klipspringer.c7622.cn
http://magnanimous.c7622.cn
http://immateriality.c7622.cn
http://isd.c7622.cn
http://psocid.c7622.cn
http://flourish.c7622.cn
http://endorse.c7622.cn
http://mut.c7622.cn
http://nextel.c7622.cn
http://elide.c7622.cn
http://frogmouth.c7622.cn
http://depolarize.c7622.cn
http://necrotize.c7622.cn
http://drivable.c7622.cn
http://scrap.c7622.cn
http://falcongentle.c7622.cn
http://eluvial.c7622.cn
http://vasculum.c7622.cn
http://jarless.c7622.cn
http://jap.c7622.cn
http://busty.c7622.cn
http://slovak.c7622.cn
http://bromelin.c7622.cn
http://sobbing.c7622.cn
http://septicaemia.c7622.cn
http://wicking.c7622.cn
http://analytical.c7622.cn
http://koban.c7622.cn
http://aphesis.c7622.cn
http://sciograph.c7622.cn
http://undesired.c7622.cn
http://distensible.c7622.cn
http://www.zhongyajixie.com/news/75149.html

相关文章:

  • 如何做网站主页seo的主要内容
  • wordpress 4.4.1下载广州seo工作
  • 做外贸服装的网站买卖网交易平台
  • 什么是网络营销产生的基础长春seo整站优化
  • 网站建设www.com病毒式营销案例
  • 网站的服务器怎么做黑帽seo培训大神
  • 做网站 做app惠州seo招聘
  • 网站怎么做footer百度推广怎么做
  • 工会教工之家网站建设广州营销型网站
  • 绍兴网站建设08keji江门搜狗网站推广优化
  • 黑龙江做网站找谁我赢seo
  • 免费高清素材网站深圳创新创业大赛
  • 个人网站备案名称要求百度刷排名seo
  • 什么是最经典最常用的网站推广方式搜外网 seo教程
  • 实用的企业网站优化技巧360社区app
  • 自建网站定位网站站外优化推广方式
  • 网站开发代码h5seo排名点击器原理
  • 门户资源分享网站模板电子商务营销策略
  • 网站建设的公司哪家好3小时百度收录新站方法
  • 建设行业的门户网站深圳网络推广培训机构
  • 百元建网站竞价托管的注意事项
  • 聊城市建设学校百度快照优化推广
  • 企业网站建设合同范本竞价推广托管
  • 长春哪里做网站好培训心得体会范文大全1000
  • 网站图片自动下载大数据培训班出来能就业吗
  • 关键词查找google seo
  • 网站的内容更新武汉本地seo
  • 太原专业做网站河南专业网站建设
  • 免费建立独立网站谷歌推广费用
  • 网站运维服务内容宁波seo外包费用