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

怎么使用wordpress建站策划营销有限公司

怎么使用wordpress建站,策划营销有限公司,展览展示设计网站,遂昌建设局网站前面已经学习了ArkTs的基本语法和DevEcoStudio的基本操作#xff0c;接下来按照官方提示开发一个基本案例。 该案例是系统自带的demo#xff0c;下载下来源代码后可以直接运行。 接下来我来演示如何运行demo。我在demo中加入了自己的注释。 切记#xff1a;文件夹不能有中… 前面已经学习了ArkTs的基本语法和DevEcoStudio的基本操作接下来按照官方提示开发一个基本案例。 该案例是系统自带的demo下载下来源代码后可以直接运行。 接下来我来演示如何运行demo。我在demo中加入了自己的注释。 切记文件夹不能有中文这点华为有点不厚道。现在idea都支持全中文了。 打开DS编辑器点击Open 点击TrustProject 点击ThisWindows 打开后,会自动显示MD的内容 使用说明 点击打印水仙花数按钮弹窗展示1000以内的水仙花数。 点击打印九九乘法表按钮弹窗提醒用户通过日志查看。 点击判断字符串是否为回文字符串按钮弹窗提醒用户输入字符串点击按钮即可弹窗告知用户是否为回文字符串。 点击字符串反转按钮弹窗提醒用户输入字符串点击按钮即可弹窗显示反转字符串。 点击判断是否为闰年按钮弹窗提醒用户输入年份点击按钮即可弹窗显示该年份是否为闰年。 ├──entry/src/main/ets/ │ ├──common │ │ ├──constants │ │ │ └──Constants.ets // 常量类 │ │ └──utils │ │ ├──CommonUtils.ets // 弹窗工具类 │ │ ├──Logger.ets // 日志工具类 │ │ └──Method.ets // 算法工具类 │ ├──entryability │ │ └──EntryAbility.ets │ ├──entrybackupability │ │ └──EntryBackupAbility.ets.ets │ ├──pages │ │ └──Index.ets // 界面实现 │ └──view │ ├──DaffodilsNumberCustomDialog.ets // 水仙花数弹窗实现 │ ├──IsLeapYearCustomDialog.ets // 闰年判断数弹窗实现 │ ├──IsPalindromicStringCustomDialog.ets // 回文字符串判断数弹窗实现 │ ├──MultiplicationTableCustomDialog.ets // 九九乘法表弹窗实现 │ └──StringReversalCustomDialog.ets // 字符串反转弹窗实现 └───entry/src/main/resources // 应用资源目录 nbsp;应用资源目录 华为将第一个项目整得太复杂了如果是新手的话看到这个项目基本上就是我是谁我在哪 这里面用到了非常多的封装例如common的封装字符串封装单位常量的封装包括MVVC的分层结构作为小白来说这纯纯的zhuangB啊。 本地化 其实主要的核心方法都是一个ets文件里面做了封装。 /** Copyright (c) 2024 Huawei Device Co., Ltd.* Licensed under the Apache License, Version 2.0 (the License);* you may not use this file except in compliance with the License.* You may obtain a copy of the License at** http://www.apache.org/licenses/LICENSE-2.0** Unless required by applicable law or agreed to in writing, software* distributed under the License is distributed on an AS IS BASIS,* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.*/ // 水仙花数字 export function daffodilsNumber(): number[] {let result: number[] [];for (let i 100; i 1000; i) {let unitsDigit: number i % 10;let tenthsDigit: number Math.floor(i / 10) - Math.floor(i / 100) * 10;let hundredthsDigit: number Math.floor(i / 100);if (i unitsDigit * unitsDigit * unitsDigit tenthsDigit * tenthsDigit * tenthsDigit hundredthsDigit * hundredthsDigit * hundredthsDigit) {result.push(i);}}return result; }// 乘法口诀表 export function multiplicationTable(): string[][] {let result: string[][] [];for (let i 1; i 9; i) {let index: string[] [];for (let j 1; j i; j) {let temp: string j * i i * j;index.push(temp);}result.push(index);}return result; } // 是否回文 export function isPalindromicString(content: string): boolean {let result: boolean true;let i: number 0;let j: number content.length - 1;while (i j) {if (content.charAt(i) ! content.charAt(j)) {result false;break;}i;j--;}return result; } //字符串反转 export function stringReversal(content: string): string {let result: string ;for (let index content.length - 1; index 0; index--) {result content.charAt(index);}return result; } // 是否闰年 export function isLeapYear(year: number): boolean {let result: boolean false;if ((year % 4 0 year % 100 ! 0) || (year % 400 0)) {result true;} else {result false;}return result; } 华为不地道真的不地道所有的代码完全没有一点中文这上面的出现的中文注释都是我加进去的。 下面来看看闰年是如何写的代码 /** Copyright (c) 2024 Huawei Device Co., Ltd.* Licensed under the Apache License, Version 2.0 (the License);* you may not use this file except in compliance with the License.* You may obtain a copy of the License at** http://www.apache.org/licenses/LICENSE-2.0** Unless required by applicable law or agreed to in writing, software* distributed under the License is distributed on an AS IS BASIS,* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.*/ // 常量类 import { CommonConstants } from ../common/constants/Constants; // 工具类,里面包含了一个showToast方法 import CommonUtils from ../common/utils/CommonUtils; // 引入判断闰年的方法 import { isLeapYear } from ../common/utils/Method;CustomDialog Component export struct IsLeapYearCustomDialog {State content: string ;State result: boolean false;IsPalindromicStringCustomDialogController?: CustomDialogController;build() { // 构造器Column() { // 布局器Column() { // 列布局// 铺界面 文本Text($r(app.string.ArkTS_Development_Case)).height($r(app.float.button_height)).font({ size: $r(sys.float.ohos_id_text_size_headline8) }).fontColor($r(sys.color.ohos_id_color_text_primary)).margin({ top: $r(app.float.dialog_text_margin_top) })Text($r(app.string.Judgment_of_leap_year)).font({ size: $r(sys.float.ohos_id_text_size_body2) }).fontColor($r(sys.color.ohos_id_color_text_secondary)).margin({ left: $r(app.float.dialog_text_margin_left) })}.alignItems(HorizontalAlign.Center).width(CommonConstants.PERCENT_FULL).height($r(app.float.dialog_text_height))// 可编辑文本框TextInput({ placeholder: CommonConstants.LEAP_YEAR_INPUT }).margin({ top: $r(app.float.dialog_padding) }).height($r(app.float.dialog_textInput_height)).showUnderline(true).onChange((value: string) {this.content value;})// 点击按钮,判断是否闰年Button($r(app.string.IsLeapYear)).width($r(app.float.dialog_button_width)).margin({top: $r(app.float.button_margin_bottom),bottom: $r(app.float.dialog_padding)}).onClick(() {// 这里开始正式调用判断闰年的方法this.result isLeapYear(Number.parseInt(this.content));if (this.result) {// 是否闰年,使用showToast显示CommonUtils.showToast(CommonConstants.LEAP_YEAR_YES);} else {CommonUtils.showToast(CommonConstants.LEAP_YEAR_NO);}})}.alignItems(HorizontalAlign.Center).padding({left: $r(app.float.dialog_padding),right: $r(app.float.dialog_padding)})} } 还是一样中文注释都是我加进去的。里面没有出现任何一个中文字符。 总结 华为鸿蒙next开发可能太希望能做标准化了作为新手入门的第一个项目基本上所有的代码都封装了非常标准分层本地化都做到了但是这能入门吗 如果作为一个老鸟以后的项目参考这个项目来写还是非常有帮助的如需下载项目请直接去官网。 需要我的这份也可以留下email即可发送。
http://www.dnsts.com.cn/news/224968.html

相关文章:

  • 梅州做网站企业营销策划及推广
  • 网站关键词抓取莆田专门做网站
  • ui外包网站广告外链购买平台
  • 关键词全网搜索指数郑州官网网站推广优化公司
  • 网站建设丶金手指下拉14电子商务网站建设交印花税吗
  • 青羊区企业网站建设策划乌托邦网站建设
  • 网站建设和管理的总结怎么写wordpress 分类标签云
  • 淄博网站推广马尔康网站建设
  • 网站改版 如何改版app开发网站排行榜
  • 邯郸做移动网站费用优化seo培训班
  • 张家港网站建设培训学校网站建设费用主要包括哪些内容
  • 从化低价网站建设数据网站排名
  • 中国建设银行贷款官网站个人网站创建平台要多少钱
  • 做动画人设有哪些网站可以借鉴最炫表白网站html5源码
  • 手机做公司网站wordpress 婚礼
  • 营销网站建设培训学校json做网站
  • 做行业网站广告能赚多少钱做网站的规范尺寸
  • 网站2级页面怎么做中核集团八大子公司
  • 湖南智能网站建设推荐建个网站大概需要多久
  • 搭建公司网站的作用达人室内设计网怎么免费注册
  • 全屋整装装修效果江门当地的免费网站优化
  • 沈阳专业做网站公司wordpress打不开
  • 九度企业网站推广软件辽宁千山科技做网站怎么样
  • 星彩医美连锁官方网站建设站长网seo综合查询工具
  • 做虾皮网站赚钱吗域名收录查询
  • 群晖可以做网站服务器吗新余服装网站建设
  • 建设门户网站都需要什么意思wordpress营销型主题
  • 用什么做网站后台深圳个人网站制作
  • 怎么看网站的ftp为什么我有的网站打不开
  • 怎么判断网站优化过度自助建站seo