003 常用组件开发使用

news2024/7/11 13:47:34

目录

一.基础组件

Blank:填充控件

Button:按钮

ButtonType枚举说明

Text:文本显示

QRCode

二.常用布局

线性布局(Row和Column)

层叠布局

弹性布局(Flex)


一.基础组件

Blank:填充控件

这个是鸿蒙新增的Android开发中没有的组件,主要作用是空白填充组件,在容器主轴方向上,空白填充组件具有自动填充容器空余部分的能力。仅当父组件为Row/Column时生效。

1.使用方式

Blank(min?: number | string).color(color:ResourceColor)

min:空白填充组件在容器主轴上的最小大小。默认值:0。在父组件横向排列子组件时如果没有设置父组件的宽度并且没有设置min则看不见Blank填充显示,此时min参数就发挥作用了。

color:填充颜色

2.示例

@Entry

@Component

struct Index {

  @State message: string = 'Hello World'

  build() {

    Column() {

      Row() {

        Text('Bluetooth').fontSize(18)

        //最小值

        Blank().color(Color.White)

        Toggle({ type: ToggleType.Switch })

      }.width('100%').backgroundColor(0xFFFFFF)

      .borderRadius(15).padding({ left: 12 })

      .margin({bottom:50})

      Row() {

        Text('Bluetooth').fontSize(18)

        //在父组件没有设置宽度时设置最小值

        Blank(100).color(Color.Black)

        Toggle({ type: ToggleType.Switch })

      }.backgroundColor(0xFFFFFF).borderRadius(15).padding({ left: 12 })

    }.backgroundColor(0xEFEFEF).padding(20)

  }

}

3.显示内容

竖屏状态

横屏状态

Button:按钮

按钮组件,可快速创建不同样式的按钮。

1.使用方式

有两种使用方式如下:

Button(options?: {type?: ButtonType, stateEffect?: boolean})

type:描述按钮显示样式。默认值:ButtonType.Capsule

stateEffect:按钮按下时是否开启按压态显示效果,当设置为false时,按压效果关闭。默认值:true

说明:当开启按压态显示效果,开发者设置状态样式时,会基于状态样式设置完成后的背景色再进行颜色叠加。

Button(label?: ResourceStr, options?: { type?: ButtonType, stateEffect?: boolean })

label:按钮文本内容。如果设置了label则不能在Button中设置子组件

属性

type:同上

stateEffect:同上

ButtonType枚举说明

Capsule:胶囊型按钮(圆角默认为高度的一半)。

Circle:圆形按钮。

Normal:普通按钮(默认不带圆角)。

示例:

// xxx.ets

@Entry

@Component

struct ButtonExample {

  build() {

    Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Start, justifyContent: FlexAlign.SpaceBetween }) {

      Text('Normal button').fontSize(9).fontColor(0xCCCCCC)

      Flex({ alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) {

        Button('OK', { type: ButtonType.Normal, stateEffect: true })

          .borderRadius(8)

          .backgroundColor(0x317aff)

          .width(90)

          .onClick(() => {

            console.log('ButtonType.Normal')

          })

        Button({ type: ButtonType.Normal, stateEffect: true }) {

          Row() {

            LoadingProgress().width(20).height(20).margin({ left: 12 }).color(0xFFFFFF)

            Text('loading').fontSize(12).fontColor(0xffffff).margin({ left: 5, right: 12 })

          }.alignItems(VerticalAlign.Center)

        }.borderRadius(8).backgroundColor(0x317aff).width(90).height(40)

        Button('Disable', { type: ButtonType.Normal, stateEffect: false }).opacity(0.4)

          .borderRadius(8).backgroundColor(0x317aff).width(90)

      }

      Text('Capsule button').fontSize(9).fontColor(0xCCCCCC)

      Flex({ alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) {

        Button('OK', { type: ButtonType.Capsule, stateEffect: true }).backgroundColor(0x317aff).width(90)

        Button({ type: ButtonType.Capsule, stateEffect: true }) {

          Row() {

            LoadingProgress().width(20).height(20).margin({ left: 12 }).color(0xFFFFFF)

            Text('loading').fontSize(12).fontColor(0xffffff).margin({ left: 5, right: 12 })

          }.alignItems(VerticalAlign.Center).width(90).height(40)

        }.backgroundColor(0x317aff)

        Button('Disable', { type: ButtonType.Capsule, stateEffect: false }).opacity(0.4)

          .backgroundColor(0x317aff).width(90)

      }

      Text('Circle button').fontSize(9).fontColor(0xCCCCCC)

      Flex({ alignItems: ItemAlign.Center, wrap: FlexWrap.Wrap }) {

        Button({ type: ButtonType.Circle, stateEffect: true }) {

          LoadingProgress().width(20).height(20).color(0xFFFFFF)

        }.width(55).height(55).backgroundColor(0x317aff)

        Button({ type: ButtonType.Circle, stateEffect: true }) {

          LoadingProgress().width(20).height(20).color(0xFFFFFF)

        }.width(55).height(55).margin({ left: 20 }).backgroundColor(0xF55A42)

      }

    }.height(400).padding({ left: 35, right: 35, top: 35 })

  }

}

显示样式:

Text:文本显示

显示一段文本的组件。

用法

Text(content?: string | Resource)

content:文本内容。包含子组件Span时不生效,显示Span内容,并且此时text组件的样式不生效。默认值:' '

属性

名称

参数类型

描述

textAlign

TextAlign

设置文本段落在水平方向的对齐方式

默认值:TextAlign.Start

说明:

文本段落宽度占满Text组件宽度;可通过align属性控制文本段落在垂直方向上的位置。

从API version 9开始,该接口支持在ArkTS卡片中使用。

textOverflow

{overflow: TextOverflow}

设置文本超长时的显示方式。

默认值:{overflow: TextOverflow.Clip}

说明:

文本截断是按字截断。例如,英文以单词为最小单位进行截断,若需要以字母为单位进行截断,可在字母间添加零宽空格:\u200B。

需配合maxLines使用,单独设置不生效。

从API version 9开始,该接口支持在ArkTS卡片中使用。

maxLines

number

设置文本的最大行数。

默认值:Infinity

说明:

默认情况下,文本是自动折行的,如果指定此参数,则文本最多不会超过指定的行。如果有多余的文本,可以通过 textOverflow来指定截断方式。

从API version 9开始,该接口支持在ArkTS卡片中使用。

lineHeight

string | number | Resource

设置文本的文本行高,设置值不大于0时,不限制文本行高,自适应字体大小,Length为number类型时单位为fp。

从API version 9开始,该接口支持在ArkTS卡片中使用。

decoration

{

type: TextDecorationType,

color?: ResourceColor

}

设置文本装饰线样式及其颜色。

默认值:{

type: TextDecorationType.None,

color:Color.Black

}

从API version 9开始,该接口支持在ArkTS卡片中使用。

baselineOffset

number | string

设置文本基线的偏移量,默认值0。

从API version 9开始,该接口支持在ArkTS卡片中使用。

说明:

设置该值为百分比时,按默认值显示。

letterSpacing

number | string

设置文本字符间距。

从API version 9开始,该接口支持在ArkTS卡片中使用。

说明:

设置该值为百分比时,按默认值显示。

minFontSize

number | string | Resource

设置文本最小显示字号。

需配合maxFontSize以及maxline或布局大小限制使用,单独设置不生效。

从API version 9开始,该接口支持在ArkTS卡片中使用。

maxFontSize

number | string | Resource

设置文本最大显示字号。

需配合minFontSize以及maxline或布局大小限制使用,单独设置不生效。

从API version 9开始,该接口支持在ArkTS卡片中使用。

textCase

TextCase

设置文本大小写。

默认值:TextCase.Normal

从API version 9开始,该接口支持在ArkTS卡片中使用。

copyOption9+

CopyOptions

组件支持设置文本是否可复制粘贴。

默认值:CopyOptions.None

该接口支持在ArkTS卡片中使用。

示例1

textAlign,textOverflow,maxLines,lineHeight使用示例。

// xxx.ets

@Entry

@Component

struct TextExample1 {

  build() {

    Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Start, justifyContent: FlexAlign.SpaceBetween }) {

      // 文本水平方向对齐方式设置

      // 单行文本

      Text('textAlign').fontSize(9).fontColor(0xCCCCCC)

      Text('TextAlign set to Center.')

        .textAlign(TextAlign.Center)

        .fontSize(12)

        .border({ width: 1 })

        .padding(10)

        .width('100%')

      Text('TextAlign set to Start.')

        .textAlign(TextAlign.Start)

        .fontSize(12)

        .border({ width: 1 })

        .padding(10)

        .width('100%')

      Text('TextAlign set to End.')

        .textAlign(TextAlign.End)

        .fontSize(12)

        .border({ width: 1 })

        .padding(10)

        .width('100%')

      // 多行文本

      Text('This is the text content with textAlign set to Center.')

        .textAlign(TextAlign.Center)

        .fontSize(12)

        .border({ width: 1 })

        .padding(10)

        .width('100%')

      Text('This is the text content with textAlign set to Start.')

        .textAlign(TextAlign.Start)

        .fontSize(12)

        .border({ width: 1 })

        .padding(10)

        .width('100%')

      Text('This is the text content with textAlign set to End.')

        .textAlign(TextAlign.End)

        .fontSize(12)

        .border({ width: 1 })

        .padding(10)

        .width('100%')

      // 文本超长时显示方式

      Text('TextOverflow+maxLines').fontSize(9).fontColor(0xCCCCCC)

      // 超出maxLines截断内容展示

      Text('This is the setting of textOverflow to Clip text content This is the setting of textOverflow to None text content. This is the setting of textOverflow to Clip text content This is the setting of textOverflow to None text content.')

        .textOverflow({ overflow: TextOverflow.None })

        .maxLines(1)

        .fontSize(12)

        .border({ width: 1 })

        .padding(10)

      // 超出maxLines展示省略号

      Text('This is set textOverflow to Ellipsis text content This is set textOverflow to Ellipsis text content.'.split('')

        .join('\u200B'))

        .textOverflow({ overflow: TextOverflow.Ellipsis })

        .maxLines(1)

        .fontSize(12)

        .border({ width: 1 })

        .padding(10)

      Text('lineHeight').fontSize(9).fontColor(0xCCCCCC)

      Text('This is the text with the line height set. This is the text with the line height set.')

        .fontSize(12).border({ width: 1 }).padding(10)

      Text('This is the text with the line height set. This is the text with the line height set.')

        .fontSize(12).border({ width: 1 }).padding(10)

        .lineHeight(20)

    }.height(600).width(350).padding({ left: 35, right: 35, top: 35 })

  }

}

显示内容如下:

示例2

decoration,baselineOffset,letterSpacing,textCase使用示例:

@Entry

@Component

struct TextExample2 {

  build() {

    Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Start, justifyContent: FlexAlign.SpaceBetween }) {

      Text('decoration').fontSize(9).fontColor(0xCCCCCC)

      Text('This is the text content with the decoration set to LineThrough and the color set to Red.')

        .decoration({

          type: TextDecorationType.LineThrough,

          color: Color.Red

        })

        .fontSize(12)

        .border({ width: 1 })

        .padding(10)

        .width('100%')

      Text('This is the text content with the decoration set to Overline and the color set to Red.')

        .decoration({

          type: TextDecorationType.Overline,

          color: Color.Red

        })

        .fontSize(12)

        .border({ width: 1 })

        .padding(10)

        .width('100%')

      Text('This is the text content with the decoration set to Underline and the color set to Red.')

        .decoration({

          type: TextDecorationType.Underline,

          color: Color.Red

        })

        .fontSize(12)

        .border({ width: 1 })

        .padding(10)

        .width('100%')

      // 文本基线偏移

      Text('baselineOffset').fontSize(9).fontColor(0xCCCCCC)

      Text('This is the text content with baselineOffset 0.')

        .baselineOffset(0)

        .fontSize(12)

        .border({ width: 1 })

        .padding(10)

        .width('100%')

      Text('This is the text content with baselineOffset 30.')

        .baselineOffset(30)

        .fontSize(12)

        .border({ width: 1 })

        .padding(10)

        .width('100%')

      Text('This is the text content with baselineOffset -20.')

        .baselineOffset(-20)

        .fontSize(12)

        .border({ width: 1 })

        .padding(10)

        .width('100%')

      // 文本字符间距

      Text('letterSpacing').fontSize(9).fontColor(0xCCCCCC)

      Text('This is the text content with letterSpacing 0.')

        .letterSpacing(0)

        .fontSize(12)

        .border({ width: 1 })

        .padding(10)

        .width('100%')

      Text('This is the text content with letterSpacing 3.')

        .letterSpacing(3)

        .fontSize(12)

        .border({ width: 1 })

        .padding(10)

        .width('100%')

      Text('This is the text content with letterSpacing -1.')

        .letterSpacing(-1)

        .fontSize(12)

        .border({ width: 1 })

        .padding(10)

        .width('100%')

      Text('textCase').fontSize(9).fontColor(0xCCCCCC)

      Text('This is the text content with textCase set to Normal.')

        .textCase(TextCase.Normal)

        .fontSize(12)

        .border({ width: 1 })

        .padding(10)

        .width('100%')

      // 文本全小写展示

      Text('This is the text content with textCase set to LowerCase.')

        .textCase(TextCase.LowerCase)

        .fontSize(12)

        .border({ width: 1 })

        .padding(10)

        .width('100%')

      // 文本全大写展示

      Text('This is the text content with textCase set to UpperCase.')

        .textCase(TextCase.UpperCase)

        .fontSize(12).border({ width: 1 }).padding(10)

    }.height(700).width(350).padding({ left: 35, right: 35, top: 35 })

  }

}

显示内容如下:

QRCode

用于显示单个二维码的组件。

用法:

QRCode(value: string)

value:传入用于生成二维码的字符串

属性:

color:设置二维码颜色

backgroundColor:设置二维码背景颜色

示例:

// xxx.ets

@Entry

@Component

struct QRCodeExample {

  private value: string = 'hello world'

  build() {

    Column({ space: 5 }) {

      Text('normal').fontSize(9).width('90%').fontColor(0xCCCCCC).fontSize(30)

      QRCode(this.value).width(200).height(200)

      // 设置二维码颜色

      Text('color').fontSize(9).width('90%').fontColor(0xCCCCCC).fontSize(30)

      QRCode(this.value).color(0xF7CE00).width(200).height(200)

      // 设置二维码背景色

      Text('backgroundColor').fontSize(9).width('90%').fontColor(0xCCCCCC).fontSize(30)

      QRCode(this.value).width(200).height(200).backgroundColor(Color.Orange)

    }.width('100%').margin({ top: 5 })

  }

}

显示如下:

二.常用布局

线性布局(Row和Column)

Row和Colum的线性布局,类似于android的LinearLayout,其中Row是横向的线性布局,Column是竖向的线性布局

参数:

{   space?: string | number;    }

space是item中间的间距

属性:

alignItems(value: HorizontalAlign)

justifyContent(value: FlexAlign)

alignItems:这个是Column中子组件的左中右布局方向,Row同理是子组件的上中下方向

justifyContent:这个是Column中子组件的竖向方向布局,Row中同理是子组件中横向的布局,不过值较多,需要结合图片理解,如下:

示例:

// xxx.ets

@Entry

@Component

struct RowAndColumnTest {

  build() {

    Column({}) {

      Column() {

      }.width('80%').height(50).backgroundColor(0xF5DEB3)

      Column() {

      }.width('80%').height(50).backgroundColor(0xD2B48C)

      Column() {

      }.width('80%').height(50).backgroundColor(0xF5DEB3)

    }.width('100%').height(300).backgroundColor('rgb(242,242,242)').justifyContent(FlexAlign.SpaceEvenly)

  }

}

 

// xxx.ets

@Entry

@Component

struct QRCodeExample {

  private value: string = 'hello world'

  build() {

    Column({ space: 5 }) {

      Text('normal').fontSize(9).width('90%').fontColor(0xCCCCCC).fontSize(30)

      QRCode(this.value).width(200).height(200)

      // 设置二维码颜色

      Text('color').fontSize(9).width('90%').fontColor(0xCCCCCC).fontSize(30)

      QRCode(this.value).color(0xF7CE00).width(200).height(200)

      // 设置二维码背景色

      Text('backgroundColor').fontSize(9).width('90%').fontColor(0xCCCCCC).fontSize(30)

      QRCode(this.value).width(200).height(200).backgroundColor(Color.Orange)

    }.width('100%').margin({ top: 5 }).alignItems(HorizontalAlign.End)

  }

}

层叠布局

类似于android的帧布局,子组件可以叠加上去,并且可以控制叠加的顺序。

主要参数:

alignContent:对其方式,子控件对齐父控件的位置

zIndex:子组件的叠层排序,zIndex值大的组件会覆盖在zIndex值小的组件上方。

示例:

@Entry

@Component

struct StackTest {

  build() {

    Stack({ alignContent: Alignment.BottomStart }) {

      Column() {

        Text('Stack子元素1').fontSize(20)

      }.width(100).height(100).backgroundColor(0xffd306).zIndex(2)

      Column() {

        Text('Stack子元素2').fontSize(20)

      }.width(150).height(150).backgroundColor(Color.Pink).zIndex(1)

      Column() {

        Text('Stack子元素3').fontSize(20)

      }.width(200).height(200).backgroundColor(Color.Grey)

    }.margin({ top: 100 }).width(350).height(350).backgroundColor(0xe0e0e0)

  }

}

显示如下:

弹性布局(Flex)

Android中没有对应的布局,简单来说就是更加人性化的将子组件放到合适的位置,在设置可以换行的情况下子组件比较多宽度不足的情况下自动将子组件换行到下一行显示

使用方式:

参数名

参数类型

必填

默认值

参数描述

direction

FlexDirection

FlexDirection.Row

子组件在Flex容器上排列的方向,即主轴的方向。

wrap

FlexWrap

FlexWrap.NoWrap

Flex容器是单行/列还是多行/列排列。

说明:

在多行布局时,通过交叉轴方向,确认新行堆叠方向。

justifyContent

FlexAlign

FlexAlign.Start

子组件在Flex容器主轴上的对齐格式。

alignItems

ItemAlign

ItemAlign.Start

子组件在Flex容器交叉轴上的对齐格式。

alignContent

FlexAlign

FlexAlign.Start

交叉轴中有额外的空间时,多行内容的对齐方式。仅在wrap为Wrap或WrapReverse下生效。

示例:

@Entry

@Component

struct FlexTest{

  build(){

    Flex({ justifyContent: FlexAlign.End,wrap :FlexWrap.Wrap }) {

      Text('1').width('40%').height(50).backgroundColor(0xF5DEB3)

      Text('2').width('40%').height(50).backgroundColor(0xD2B48C)

      Text('3').width('40%').height(50).backgroundColor(0xF5DEB3)

    }

    .width('90%')

    .padding({ top: 10, bottom: 10 })

    .backgroundColor(0xAFEEEE)

  }

}

显示如下:

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/443246.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

涨薪5k,100多天从功能测试进阶自动化测试,我整理的超全学习指南

个人简介 学渣一枚,2017年6月某大专学校毕业,从事功能测试已经4年,最初毕业是从事了一份销售的工作,工资当时好像是3k,可能也是我个人的原因不适合销售,后来在朋友的介绍下转行到了测试行业,转…

访问者模式解读

目录 问题引进 访问者模式基本介绍 基本介绍 访问者模式的原理类图 对原理类图的说明 访问者模式应用实例 思路分析和图解(类图) 代码实战 应用案例的小结 访问者模式的注意事项和细节 优点 问题引进 测评系统的需求 1) 将观众分为男人和女人,对歌手进行…

FPGA基于XDMA实现PCIE X8通信方案测速 提供工程源码和QT上位机程序和技术支持

目录 1、前言2、我已有的PCIE方案3、PCIE理论4、总体设计思路和方案5、vivado工程详解6、驱动安装7、QT上位机软件8、上板调试验证9、福利:工程代码的获取 1、前言 PCIE(PCI Express)采用了目前业内流行的点对点串行连接,比起 PC…

Ceph手动部署(开发版本)

手动部署 监视器引导管理器守护程序配置添加 OSD 简写形式长格式添加 MDS总结在 FreeBSD 上手动部署 FreeBSD 上的 Disklayout 配置监视器引导添加 OSD 长格式添加 MDS总结 手动部署 所有 Ceph 集群至少需要一个显示器,并且至少需要与 存储在群集上的对象的副本…

Hacked某安汽车车机系统

很久之前尝试对某安汽车的车机系统进行渗透测试,但是却卡在入口无法进入,尝试暴力破解但是字典不够强大,没能成功。前段时间看到了绿盟科技博客的《新型车机,如何攻防?》感觉有点熟悉,再次探索发现可以获得…

京东商品评论数据爬虫,包含对数据的采集、清洗、可视化、分析等过程,作为数据库课程。

感谢大家的star和fork,为了感谢大家的关注,特意对代码进行了优化,对最新的url格式进行了更新,减少了一些冗余的参数,希望能够帮助大家入门爬虫,已经爬好的京东的商品评论数据已经存储在data目录下&#xff…

软件测试标准GB/T 25000.51-2016中的八大软件质量特性

GB/T25000标准由下图所示的21个部分组成,其中GB/T 25000.10和GB/T 25000.51是建立软件测试技术体系可以参考的部分,GB/T 25000.51尤为重要。 GB/T 25000标准总标题(21个部分) GB/T 25000.51标准pdf封面 GB/T 25000.51-2016 《系统…

现在有t1,t2,t3三个线程,实现t1,t2线程同步执行,然后再执行t3线程,使用Java实现该程序

目录 1、利用CountDownLatch 2、利用Future 最近在面试的时候,经常遇到这个题目,首先从题目上看,就知道考察的是多线程方面知识,我第一次看到这个题目的时候,就想到了使用CountDownLatch这个计数器来实现&#xff0c…

AUTOSAR网络管理

功能说明 目前车辆上ECU的数目越来越多,不同功能的ECU对电源有不同的要求,在点火钥匙打到OFF档(KL15停止供电)之后,有的ECU(如座椅模块)允许直接断电,有的ECU(如空调模块…

浅谈操作系统OS与计算机软硬件体系结构,自顶贯穿性与行为回归硬件性

操作系统OS与计算机软硬件体系结构 使计算机更好用! 这是操作系统的根本要义!! 操作系统这个概念基本上以后会讲一路的,今天的话就基本上讲一下轻量化的概念。所以操作系统到底是什么?操作系统首先是软件,那它是一款什么软件呢&#xff1f…

Java读取文件方式

IO流读取 文本内容 按行读取文件内容 指定编码格式(推荐) public static void main(String[] args) throws UnsupportedEncodingException {read("D:\\test.txt");}public static void read(String path) {BufferedReader reader null;try …

Spring Security 01 整体架构

目录 认证 AuthenticationManager ProviderManager AuthenticationProvider Authentication SecurityContextHolder 授权 AccessDecisionManager AccessDecisionVoter RoleVoter AuthenticatedVoter Custom Voters ConfigAttribute 在SpringSecurity的架构中&…

Linux如何使用宝塔面板搭建网站和内网穿透实现公网访问

文章目录 前言1. 环境安装2. 安装cpolar内网穿透3. 内网穿透4. 固定http地址5. 配置二级子域名6. 创建一个测试页面 转载自远程内网穿透的文章:Linux使用宝塔面板搭建网站,并内网穿透实现公网访问 前言 宝塔面板作为简单好用的服务器运维管理面板&#…

Flink从入门到精通之-06Flink 中的时间和窗口

Flink从入门到精通之-06Flink 中的时间和窗口 我们已经了解了基本 API 的用法,熟悉了 DataStream 进行简单转换、聚合的一些操作。除此之外,Flink 还提供了丰富的转换算子,可以用于更加复杂的处理场景。 在流数据处理应用中,一个…

NM储存卡数据丢失怎么办?四招数据恢复宝典

NM卡像其他类型的存储设备一样,也有可能因为各种原因导致数据丢失,比如误删除、格式化、病毒感染等。因此,在使用NM卡时,仍需注意数据备份和安全性,以避免面临重要数据丢失风险。如果不幸发生了数据丢失,应…

python中unexpected indent报错的解决办法

python中unexpected indent报错的解决办法 在我们初步学习pyton的时候,由于对python语言的学习掌握不充分,则会导致所编写的代码,运行时候报错。比如,容易报错的unexpected indent问题,下面举例说明问题。 1.举例&am…

Linux虚拟机中安装jdk的两种方法:

方法一:手动安装 1. 使用FinalShell自带的上传工具将jdk的二进制发布包上传到Linux 上传位置如图(底栏可以在图中的向下箭头位置自行打开与关闭): 注:默认上传地址为图片左侧的工作地址 2. 解压安装包,…

在vue2中用vue-echarts和v-charts绘制百度地图定制散点图

一、在vue-echarts中定制百度地图 效果 准备 安装依赖 echarts vue-echarts npm i echarts vue-echarts 在main.js中引入 import ECharts from “echarts” import VueECharts from “vue-echarts” Vue.prototype.$echarts ECharts Vue.component(“v-chart”, VueECharts…

SAS学习第4章:t检验

前话:分析试验数据的差异,一般都会假设样本值之间或者样本与标准值之间无差异,根据不同方法计算得出的t值、q值、F值等等,均表示两者之间的差异程度,值越大,两者差异越大,该假设越不成立&#x…

全网最全的AI绘画提示词网站,看这一篇就够了!

要说2023年什么最火,绝对是以ChatGPT为代表的AI工具了,特别是AI绘画,而用好AI的关键,就是要学会使用关键词,也叫提示词,提示词是AI绘画的核心,本次就给大家分享几个AI绘画关键词网站&#xff0c…