1.0.1 • Published 2 years ago

cardview v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

CardView_ohos

该项目是使用ETS语言开发的、基于鸿蒙TS声明式开发范式提供的API所开发的一个卡片视图组件

项目介绍

  • 项目名称:CardView(卡片视图)
  • 所属系列:鸿蒙第三方组件适配移植
  • 编程语言:eTS
  • 功能:以卡片的形式展示姓名,头像,图片等信息
  • 开发版本:sdk8、eTS语言、DevEco Studio 3.0.0.900
  • 项目发起作者:万冬阳
  • 项目演示效果:

npm.io

使用教程

1、组件的实现位于entry/src/main/ets/MainAbility/commons/components/CardView.ets,将该组件复制到所要使用该组件的项目目录下,最好可以放在/MainAbility/commons/下

2、在要使用该组件的代码页面中引入该组件。

import {CardView} from '../commons/components/CardView'

3、在代码中使用该CardView组件

@Entry
@Component
struct Index{
  build(){
    Column(){
        //使用封装的卡片视图组件
        CardView({
          //设置卡片组件的属性,如果不设置则为默认值
          attribute:{
            //设置卡片视图的名字,如果不设置则为默认值 小M
            name: "万冬阳",
            //设置卡片视图的图片,如果不设置则为默认值 icon.png
            icon: "img.png",
            //设置卡片视图的头像,如果不设置则为默认值 img_1.png
            CardImage: "img_2.png"
          }
        })
    }
  }
}

4、组件参数

      |  参数名   |    解释    |
      | :-------: | :--------: |
      |   name   |  卡片组件名字  |
      |   icon   |  卡片组件头像  |
      | CardImage|  卡片组件展示图片  |

版本迭代

  • v0.1.0-alpha