4lqedz 发表于 2024-6-29 16:19:34

从0初始在鸿蒙OS中制作一个APP!


    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://mmbiz.qpic.cn/mmbiz_gif/QFjUqsncFKlcoVjyr92kR3smBia9a5HWSEa08jzxz39RgVwVAGaekT9MqaB7k8Cs4KZjC8mrOCAGzCBhp1vp37Q/640?wx_fmt=gif&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1" style="width: 50%; margin-bottom: 20px;"></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">作者:若离链接:https://www.zhihu.com/question/420404904/answer/1465546442</p>

    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">他来了他来了,他带着质疑走来了。<span style="color: black;">没</span>论怎么说,鸿蒙OS 2.0的<span style="color: black;">颁布</span><span style="color: black;">针对</span>程序员群体<span style="color: black;">来讲</span><span style="color: black;">亦</span>应当是值得记住的时刻。毕竟有可能<span style="color: black;">将来</span><span style="color: black;">研发</span>程序的时候,<span style="color: black;">制品</span>经理<span style="color: black;">必定</span>会问:兼容鸿蒙OS吗?</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">日前</span>鸿蒙OS给大<span style="color: black;">都数</span><span style="color: black;">研发</span>者的印象<span style="color: black;">便是</span>一个PPT系统。今天和同事们聊了聊鸿蒙OS<span style="color: black;">颁布</span>,大<span style="color: black;">都数</span>人仍然持质疑的态度,似乎想要认真回答题主的问题,从0<span style="color: black;">起始</span><span style="color: black;">运用</span>鸿蒙制作一个APP似乎是一个不错的想法。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">我<span style="color: black;">期盼</span>这个应用<span style="color: black;">研发</span>完成后,我和你都有了自己的答案。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">「利益<span style="color: black;">关联</span>:一名普通的前端工程师。<span style="color: black;">无</span>安卓<span style="color: black;">研发</span>经验,<span style="color: black;">研发</span>过程中智障<span style="color: black;">行径</span>请谅解。」</strong></p>
    <h3 style="color: black; text-align: left; margin-bottom: 10px;"><span style="color: black;">零、现<span style="color: black;">周期</span>遇到的BUG汇总</span></h3>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">我会将<span style="color: black;">研发</span>过程中遇到的bug汇总到<span style="color: black;">这儿</span>,<span style="color: black;">期盼</span>能帮到Harmony框架的<span style="color: black;">研发</span>人员</p>IDE -- Project列表文件<span style="color: black;">没</span>法选中:<span style="color: black;">能够</span>选中文件夹,<span style="color: black;">经过</span>键盘操作移动到文件打开,<span style="color: black;">然则</span>有时候鼠标点击<span style="color: black;">没</span>法选中文件。比较频繁IDE -- 初次运行IDE<span style="color: black;">无</span>提示安装模拟器。在Chrome浏览器环境下,DevEco调转到网页<span style="color: black;">没</span>法停留在授权页面,<span style="color: black;">引起</span><span style="color: black;">没</span>法触发登录回调(可能<span style="color: black;">亦</span>是首次登录才会<span style="color: black;">这般</span>)。<h3 style="color: black; text-align: left; margin-bottom: 10px;"><span style="color: black;"><span style="color: black;">1、</span>环境搭建</span></h3>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">华为为HarmonyOS设计了专门的<span style="color: black;">研发</span>IDE:DevEco Studio,<span style="color: black;">日前</span>只支持Windows10,<span style="color: black;">日前</span>而言<span style="color: black;">针对</span>常年<span style="color: black;">运用</span>MacOS的前端不太友好,<span style="color: black;">不外</span>这不是问题,bootcamp<span style="color: black;">起步</span>(mac的双系统)
      !<img src="https://mmbiz.qpic.cn/mmbiz_jpg/QFjUqsncFKmNiaXr10E44ISUmqzabfxRrxWT8lBy2K2q12DefY7ZrYWEe75x9qLGp8C9ZibiabO0A7etGtorWkryw/640?wx_fmt=jpeg&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" style="width: 50%; margin-bottom: 20px;"></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">HUAWEI DevEco Studio(以下简<span style="color: black;">叫作</span>DevEco Studio)是面向华为终端全场景多设备的一站式集成<span style="color: black;">研发</span>环境(IDE),为<span style="color: black;">研发</span>者<span style="color: black;">供给</span>工程模板创建、<span style="color: black;">研发</span>、编译、调试、<span style="color: black;">颁布</span>等E2E的HarmonyOS应用<span style="color: black;">研发</span>服务。<span style="color: black;">按照</span>华为的描述,这个IDE支持多语言的<span style="color: black;">研发</span>,构建,<span style="color: black;">颁布</span>并支持多模拟器。<span style="color: black;">同期</span><span style="color: black;">必须</span>注册华为<span style="color: black;">研发</span>者账号。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://mmbiz.qpic.cn/mmbiz_png/QFjUqsncFKmNiaXr10E44ISUmqzabfxRrGmRKNxribfODvvLiaQDvyBDSRibicpDE0bWNlwmhrxyK48y3uWqMgJFW8g/640?wx_fmt=png&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" style="width: 50%; margin-bottom: 20px;"></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">IDE压缩包616M</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://mmbiz.qpic.cn/mmbiz_png/QFjUqsncFKmNiaXr10E44ISUmqzabfxRr8eXLOEb7VIk361XMZSed8LysjRBbibWms5KgBMeYeITDY3H5wlsyXfg/640?wx_fmt=png&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" style="width: 50%; margin-bottom: 20px;"></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">DevEco支持多种语言,<span style="color: black;">运用</span>JS<span style="color: black;">研发</span>的话<span style="color: black;">必须</span>安装Nodejs。看起来HarmonyOS是支持<span style="color: black;">运用</span>HTML+CSS+JS方式<span style="color: black;">研发</span>WEB应用的。<span style="color: black;">同期</span><span style="color: black;">咱们</span><span style="color: black;">重视</span>到DevEco支持的标签语言是HML,应该是华为对其进行了<span style="color: black;">有些</span>定制化的设置。</p>
    <img src="https://mmbiz.qpic.cn/mmbiz_jpg/QFjUqsncFKmNiaXr10E44ISUmqzabfxRrRn6FqanJ1OfTWR423bNV1ibprmEcYq3InVXSDjTU6W9N8VicRr8zSkAA/640?wx_fmt=jpeg&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" style="width: 50%; margin-bottom: 20px;"><img src="https://mmbiz.qpic.cn/mmbiz_jpg/QFjUqsncFKmNiaXr10E44ISUmqzabfxRrfsBdeJfZZxa1VHR8potHmOTjEGAypkxwG5B5QcGBQFGqm9TsaEt3VQ/640?wx_fmt=jpeg&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" style="width: 50%; margin-bottom: 20px;">
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">安装<span style="color: black;">无</span>什么太多的配置,下载好软件后只要电脑<span style="color: black;">能够</span>联网,DevEco会下载<span style="color: black;">关联</span>依赖。(<span style="color: black;">例如</span>Java以及<span style="color: black;">关联</span>的<span style="color: black;">工具</span>链,看起来环境变量<span style="color: black;">亦</span>自动配置了,很适合我。(<span style="color: black;">能够</span>好评)</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">安装完成后就会进入到软件主界面了,到<span style="color: black;">日前</span>为止还<span style="color: black;">无</span>遇到坑。</p><img src="https://mmbiz.qpic.cn/mmbiz_jpg/QFjUqsncFKmNiaXr10E44ISUmqzabfxRrMshrSrJLE1ho6k0WS1JeMgnVcWM6dya2yr6NmIHTff1bpcYqYQYKLQ/640?wx_fmt=jpeg&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" style="width: 50%; margin-bottom: 20px;">
    <h3 style="color: black; text-align: left; margin-bottom: 10px;"><span style="color: black;"><span style="color: black;">2、</span><span style="color: black;">研发</span>一个小的Demo</span></h3>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">咱们</span>回归到题主的问题,这个系统的前景怎么样。这个问题说实话<span style="color: black;">此刻</span>回答为时尚早,毕竟一个系统有<span style="color: black;">无</span>前途,<span style="color: black;">非常多</span>时候不是这个系统决定的。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">然则</span>有一点<span style="color: black;">能够</span>肯定,一个好的系统,其生态圈是相对容易<span style="color: black;">创立</span>的。简单<span style="color: black;">来讲</span>,<span style="color: black;">倘若</span>我这种<span style="color: black;">无</span>接触过HarmonyOS的人<span style="color: black;">亦</span>能快速<span style="color: black;">研发</span>一个App,那他<span style="color: black;">最少</span><span style="color: black;">已然</span>在答题卡上涂过答案了。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">让<span style="color: black;">咱们</span>先写一个各大前端框架介绍特性时最常用的例子:TODO List2.1 创建 App点击Create HarmonyOS Project:<span style="color: black;">日前</span>看来HarmonyOS支持TV,Wearable,Lite Wearable三种设备,有点少,<span style="color: black;">思虑</span>到Huawei是中国<span style="color: black;">机构</span>,应该不存在翻译问题,<span style="color: black;">因此</span><span style="color: black;">能够</span>说<span style="color: black;">日前</span>来看HarmonyOS不支持PC与Mobile<span style="color: black;">制品</span>。</p><img src="https://mmbiz.qpic.cn/mmbiz_jpg/QFjUqsncFKmNiaXr10E44ISUmqzabfxRribGeSkClMJXa1bUBDblibRR3AU9oEtdXBykqDGe93FODhKpak2yPOKjg/640?wx_fmt=jpeg&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" style="width: 50%; margin-bottom: 20px;">
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">咱们</span><span style="color: black;">选取</span>一个空的JS模板。(<span style="color: black;">重视</span><span style="color: black;">运用</span>JS模板你<span style="color: black;">必须</span>安装Nodejs,<span style="color: black;">倘若</span>是初学者的话很简单的,在官网下载以后就下一步下一步下一步。。。<span style="color: black;">而后</span>欢迎你<span style="color: black;">作为</span>前端工程师</p><img src="https://mmbiz.qpic.cn/mmbiz_jpg/QFjUqsncFKmNiaXr10E44ISUmqzabfxRrwDye8iaLp59s8mqiasiaBDM4bg5tZgfwslU5NyjkeNicE5WF7zAfFNlkfA/640?wx_fmt=jpeg&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" style="width: 50%; margin-bottom: 20px;">
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">到<span style="color: black;">日前</span>为止还比较顺畅,初学者<span style="color: black;">亦</span><span style="color: black;">能够</span>开启一个应用。</p>2.2 <span style="color: black;">起步</span>应用<img src="https://mmbiz.qpic.cn/mmbiz_jpg/QFjUqsncFKmNiaXr10E44ISUmqzabfxRrk2WyTiawBNCkjaDZj5vnQXzT2bbXu8icBSRDUVkdp8s9O9Jz8NceX7Og/640?wx_fmt=jpeg&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" style="width: 50%; margin-bottom: 20px;">
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">这儿</span><span style="color: black;">重视</span>到新建项目后 IDE<span style="color: black;">起始</span><span style="color: black;">运用</span>gradle下载<span style="color: black;">关联</span>的<span style="color: black;">败兴</span>。其他的回答<span style="color: black;">已然</span>有人确认这次HarmonyOS不是安卓套壳了,<span style="color: black;">因此</span>我就重复证明了,<span style="color: black;">起始</span>写代码。</p>JS UI<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">看了下官方示例,<span style="color: black;">运用</span>JAVA UI采用XML编写页面。<span style="color: black;">做为</span>前端切图仔,怎么可能用<span style="color: black;">那样</span>后端的<span style="color: black;">办法</span>呢,看了看文档,华为<span style="color: black;">供给</span>了<span style="color: black;">另一</span>一种编写方式:JS UI。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">按照</span>华为的描述,JS UI是采用类HTML与CSS来进行页面<span style="color: black;">研发</span>。<span style="color: black;">同期</span>他<span style="color: black;">亦</span>支持了JS FA的<span style="color: black;">研发</span>模式,<span style="color: black;">能够</span>将JS与JAVA混合<span style="color: black;">研发</span>。(我是不<span style="color: black;">晓得</span>混合<span style="color: black;">研发</span>有什么用,或许是后端程序员的<span style="color: black;">保持</span>吧。狗头)</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">初次运行<span style="color: black;">必须</span>安装模拟器,<span style="color: black;">根据</span>DevEco的文档说明安装模拟器是有提醒的,<span style="color: black;">然则</span><span style="color: black;">实质</span>测试我<span style="color: black;">这儿</span><span style="color: black;">无</span>提示。程序还<span style="color: black;">无</span>跑起来,我就<span style="color: black;">发掘</span>三个bug:后续我会把<span style="color: black;">运用</span>过程中的bug放到开头,<span style="color: black;">期盼</span>能帮到华为的同行们。</p>IDE初次运行<span style="color: black;">无</span>弹出安装模拟器的提示,会影响<span style="color: black;">运用</span>者体验refresh模拟器列表反复<span style="color: black;">需求</span>登录华为<span style="color: black;">研发</span>者账号,<span style="color: black;">然则</span>我<span style="color: black;">已然</span>登录了。登录<span style="color: black;">无</span>触发IDE内部的登录成功回调(<span style="color: black;">运用</span>chrome会<span style="color: black;">显现</span>这个问题)Project列表文件<span style="color: black;">没</span>法选中:可以选中文件夹,<span style="color: black;">经过</span>键盘操作移动到文件打开,<span style="color: black;">然则</span>有时候鼠标点击<span style="color: black;">没</span>法选中文件。频率比较频繁开启模拟器后,将代码稍微做一下改动:<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">开启模拟器后,将代码稍微做一下改动:</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://mmbiz.qpic.cn/mmbiz_png/QFjUqsncFKmNiaXr10E44ISUmqzabfxRrSJicXib7xV33dVHH4t83NQMbO5zR17747UhJaib998dOibic5HqDZ0aA1Vw/640?wx_fmt=png&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" style="width: 50%; margin-bottom: 20px;"></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://mmbiz.qpic.cn/mmbiz_png/QFjUqsncFKmNiaXr10E44ISUmqzabfxRrKUcccwKPa8UoEwygr5Tfxyz4Igy8DQgFoDoCR4pVEHhIDkWUUEYHKA/640?wx_fmt=png&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" style="width: 50%; margin-bottom: 20px;"></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">从UI框架来看 HarmoneyOS应用与传统应用<span style="color: black;">研发</span>差异不大,数据双向绑定的语法来看有些类似Vue。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://mmbiz.qpic.cn/mmbiz_png/QFjUqsncFKmNiaXr10E44ISUmqzabfxRrZbJ2xB2BPtiaXIHGicomyc7OlMfG880HGW7GTd6bHu8ibSklSuu2Q81Pg/640?wx_fmt=png&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" style="width: 50%; margin-bottom: 20px;"></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">2.3 新建一个有状态的List</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">今天看了许多评论,<span style="color: black;">大众</span>的发言都<span style="color: black;">特别有</span>道理。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">咱们</span>先来<span style="color: black;">知道</span>一下这个小demo的需求:</p>一个有状态的List,能够勾选与取消想要完成的任务能够新增新的任务<span style="color: black;">尽可能</span>多的调用系统API能力,肯能能调用 HarmonyOS 硬件的时间,声音,网络测试css性能,能否支持<span style="color: black;">有些</span>CSS3的动画特性调用<span style="color: black;">有些</span>HarmonyOS的分布式任务能力<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">咱们</span>先来测试一下HarmonyOS自带组件。List,华为在文档里<span style="color: black;">供给</span>了各组件的api,<span style="color: black;">位置</span>如下:</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">https://developer.harmonyos.com/cn/docs/documentation/doc-references/js-components-container-list-0000000000611496</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">根据</span>文档的例子,<span style="color: black;">咱们</span>将src → js → index中的页面代码简单修改一下</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">//index.hml</p>&lt;div&nbsp;class=<span style="color: black;">"container"</span>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">&gt;</p>&nbsp;&nbsp;&nbsp;&nbsp;&lt;text&nbsp;class=<span style="color: black;">"title"</span>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">&gt;</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{title}}</p>&nbsp;&nbsp;&nbsp;&nbsp;&lt;list&nbsp;class=<span style="color: black;">"todo-wraper"</span>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">&gt;</p>&lt;list-item<span style="color: black;">for</span>=<span style="color: black;">"{{todolist}}"</span>&nbsp;class=<span style="color: black;">"todo-item"</span>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">&gt;</p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;text&nbsp;class=<span style="color: black;">"todo-title"</span>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">&gt;{{$item.title}}</p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;text&nbsp;class=<span style="color: black;">"todo-title"</span>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">&gt;{{$item.date}}</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">//index.js</p><span style="color: black;">export</span>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">&nbsp;default&nbsp;{</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">data:&nbsp;{</p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;title:&nbsp;<span style="color: black;">"今日事,今日毕"</span>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">,</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;todolist:&nbsp;[</p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{title:&nbsp;<span style="color: black;">吃饭</span>,date:&nbsp;<span style="color: black;">10:00:00</span>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">,},</p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{title:&nbsp;<span style="color: black;">睡觉</span>,date:&nbsp;<span style="color: black;">12:00:00</span>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">,},</p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{title:&nbsp;<span style="color: black;">打豆豆</span>,date:&nbsp;<span style="color: black;">20:00:00</span>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">,}</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;],</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">&nbsp;&nbsp;&nbsp;&nbsp;},</p>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: black;"><span style="color: black;">onInit</span></span>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">()&nbsp;{</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">&nbsp;&nbsp;&nbsp;&nbsp;}</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">}</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">/*&nbsp;index.css&nbsp;*/</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">.container&nbsp;{</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">display:&nbsp;flex;</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">&nbsp;&nbsp;&nbsp;&nbsp;justify-content:&nbsp;center;</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">&nbsp;&nbsp;&nbsp;&nbsp;align-items:&nbsp;center;</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">&nbsp;&nbsp;&nbsp;&nbsp;flex-direction:column;</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">&nbsp;&nbsp;&nbsp;&nbsp;left:&nbsp;0px;</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">&nbsp;&nbsp;&nbsp;&nbsp;top:&nbsp;0px;</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">&nbsp;&nbsp;&nbsp;&nbsp;width:&nbsp;80%;</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">&nbsp;&nbsp;&nbsp;&nbsp;height:&nbsp;100%;</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">}</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">.title&nbsp;{</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">&nbsp;&nbsp;&nbsp;&nbsp;font-size:&nbsp;40px;</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">}</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">.todo-wraper{</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;padding:20px;</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">}</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">.todo-item{</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">&nbsp;&nbsp;&nbsp;&nbsp;line-hight:100px;</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">&nbsp;&nbsp;&nbsp;&nbsp;flex:1;</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">}</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">.todo-title{</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">&nbsp;&nbsp;&nbsp;&nbsp;font-wight:bold;</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">&nbsp;&nbsp;&nbsp;&nbsp;margin-right:20px;</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">}</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">全部</span>JS UI构建页面的方式与小程序是基本相同的,基本上是模板指令的一套。</p><img src="https://mmbiz.qpic.cn/mmbiz_jpg/QFjUqsncFKmNiaXr10E44ISUmqzabfxRrQuOstL0kficGOpzuMQxZdpdp7BuKNlS8saulguYLfdOm1SNrqLC9q7Q/640?wx_fmt=jpeg&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" style="width: 50%; margin-bottom: 20px;">
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">谢谢@nobody 的评论</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">「这个是快应用,类似<span style="color: black;">微X</span>小程序<span style="color: black;">同样</span>的东西,这个框架<span style="color: black;">是由于</span>小米、中兴、华为、金立、联想、魅族、努比亚、OPPO、VIVO等九家联合制定标准的。」</strong></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">看起来HarmonyOS内核上原生程序UI构建应该都会是这种模式。但我认为HarmonyOS与快应用有本质的区别,HarmonyOS并不只是<span style="color: black;">供给</span>了UI层MVVM的框架。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">「Ability是应用所具备的能力的抽象,一个应用<span style="color: black;">能够</span><span style="color: black;">包括</span>一个或多个Ability。Ability分为两种类型:FA(Feature Ability)和PA(Particle Ability)。FA/PA是应用的基本<span style="color: black;">构成</span>单元,能够实现特定的业务功能。FA有UI界面,而PA<span style="color: black;">没</span>UI界面。」</strong></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">咱们</span><span style="color: black;">此刻</span>编写的程序UI是<span style="color: black;">便是</span>一个FA,而PA<span style="color: black;">包含</span>Service与Model,分别做数据处理和<span style="color: black;">规律</span>处理的工作。(这不<span style="color: black;">便是</span>全栈吗 (#`O′))</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">废话不多说,<span style="color: black;">咱们</span>继续为应用<span style="color: black;">增多</span><span style="color: black;">有些</span>交互能力。(后续<span style="color: black;">文案</span>中...)</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">反馈一个bug:input type是checkbox时<span style="color: black;">第1</span>个元素的样式会错位</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">吐槽一下:<span style="color: black;">无</span>热加载和ui调试<span style="color: black;">工具</span>,<span style="color: black;">研发</span>效率太低了。。</p>
    <h1 style="color: black; text-align: left; margin-bottom: 10px;">
      <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">---END---</p>
      <span style="color: black;"><span style="color: black;">举荐</span>阅读:</span><span style="color: black;"><a style="color: black;">升级了,Android 11 正式<span style="color: black;">颁布</span>,偏重3大主题!</a></span><span style="color: black;"><a style="color: black;">支付宝二面:Mybatis接口Mapper内的<span style="color: black;">办法</span>为啥<span style="color: black;">不可</span>重载吗?我直接懵逼了...</a></span><span style="color: black;"><a style="color: black;">Android RecyclerView自定义LayoutManager</a></span><span style="color: black;"><a style="color: black;">知乎高赞:iOS</a> <span style="color: black;">为何</span>感觉比 Android 流畅?</span><span style="color: black;"><a style="color: black;">Android | 自定义上拉抽屉+组合动画效果</a></span><span style="color: black;"><a style="color: black;">重磅!!Gradle 6.6 <span style="color: black;">颁布</span>,大幅<span style="color: black;">提高</span>性能!</a></span><span style="color: black;"><a style="color: black;">Flutter(Flare) 最有趣用户交互动画<span style="color: black;">无</span>之一</a></span><span style="color: black;"><a style="color: black;">怒爬某破Hub站资源,只为撸这个鉴黄平台!</a></span><span style="color: black;"><a style="color: black;">Flutter 10天高仿大厂App及小技巧<span style="color: black;">累积</span>总结</a></span><span style="color: black;"><a style="color: black;">阿里巴巴官方最</a>新Redis<span style="color: black;">研发</span>规范!</span><span style="color: black;"><a style="color: black;">涉嫌侵害用户权益,这101款App被点名!</a></span>
      <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://mmbiz.qpic.cn/mmbiz_png/QFjUqsncFKlRDRs7ibC5TyHGPLqyt4yLZsZibWTDgbbS0KZzrt4iasD4vqicV6IUUZxRxicLIJZqNnxEx52GAOuQLvA/640?wx_fmt=png&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" style="width: 50%; margin-bottom: 20px;"></p>
      <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;"><span style="color: black;"><span style="color: black;">更文<span style="color: black;">很难</span>,点个“在看”支持一下

wrjc1hod 发表于 2024-9-25 21:41:10

论坛的成果是显著的,但我们不能因为成绩而沾沾自喜。

7wu1wm0 发表于 2024-10-11 11:53:41

外链发布社区 http://www.fok120.com/

wrjc1hod 发表于 2024-11-8 00:01:13

真情实感,其含义为认真了、走心了的意思,是如今的饭圈常用语。
页: [1]
查看完整版本: 从0初始在鸿蒙OS中制作一个APP!