更新升级 专属应用 系统故障 硬件故障 电脑汽车 鸿蒙刷机 鸿蒙开发Linux教程 鸿蒙开发Linux命令
当前位置:HMXT之家 > 应用开发 > 鸿蒙HarmonyOS search组件怎么使用,附代码

鸿蒙HarmonyOS search组件怎么使用,附代码

更新时间:2022-05-01 10:20:17浏览次数:430+次

以下介绍鸿蒙 ARK UI技术之HarmonyOS search组件怎么使用的方法,可先到鸿蒙文档中看search的介绍,api讲解如下截图:

\

代码运行

1、hml代码

<div class="container">

    <search hint="请输入搜索内容" searchbutton="搜索" value="11111111111">

    </search>

    <text style="font-size: 30px; color: black; width: 100%; height: 100px;">

      搜索的值:  {{this.searchValue}}

    </text>

    <text style="background-color: red; font-size: 30px; color: black; width: 100%; height: 100px;">

        翻译的值:  {{this.translateValue}}

    </text>

</div>

2、css代码

/* xxx.css */

.container {

    display: flex;

    justify-content: center;

    align-items: center;

    flex-direction: column;

}

运行效果

\

以上是动画效果。