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

江门外贸集团有限公司英文网站三亚百度推广地址

江门外贸集团有限公司英文网站,三亚百度推广地址,网站建设技术合同模板下载,科技部网站建设合同范本1、create Project,选择Empty Activity 2、配置项目 project name 为项目名称,建议使用驼峰型命名 Bundle name 为项目包名 Save location 为保存位置 Module name 为模块名称,即运行时需要选择的模块名称,见下图 查看模块名称&…

1、create Project,选择Empty Activity

在这里插入图片描述

2、配置项目

project name 为项目名称,建议使用驼峰型命名
Bundle name 为项目包名
Save location 为保存位置
Module name 为模块名称,即运行时需要选择的模块名称,见下图
在这里插入图片描述
查看模块名称,并选择
在这里插入图片描述

3、创建第一个界面

在这里插入图片描述
第一个界面实现:有一个Hello World的Text 和Button组成,点击button跳转到第二个界面中,button中带有字符串Next

import { router } from '@kit.ArkUI';
import { BusinessError } from '@kit.BasicServicesKit';@Entry
@Component
struct Index {@State message: string = 'Hello World';build() {Row(){Column() {Text(this.message).fontSize(50).fontWeight(FontWeight.Bold)// 添加按钮,以响应用户点击Button() {Text('Next').fontSize(30).fontWeight(FontWeight.Bold)}.type(ButtonType.Capsule).margin({top: 20}).backgroundColor('#0D9FFB').width('40%').height('15%').onClick(() => {console.info(`Succeeded in clicking the 'Next' button.`)// 跳转到第二页router.pushUrl({ url: 'pages/second' }).then(() => {console.info('Succeeded in jumping to the second page.')}).catch((err: BusinessError) => {console.error(`Failed to jump to the second page. Code is ${err.code}, message is ${err.message}`)})})}.width('100%')}}
}

4、创建第二个界面

在resources -> base -> profile目录下的main_pages.jason中添加界面pages/second

{"src": ["pages/Index","pages/second"]
}

在这里插入图片描述

5、第二个界面的代码实现

使用 ‘string’ 表示的是字符串

import { router } from '@kit.ArkUI'
import { BusinessError } from '@kit.BasicServicesKit'// Second.ets
@Entry
@Component
struct Second {@State message: string = 'Hi there'build() {Row() {Column() {Text(this.message).fontSize(50).fontWeight(FontWeight.Bold)Button() {Text('Back').fontSize(30).fontWeight(FontWeight.Bold)}.type(ButtonType.Capsule).margin({top: 20}).backgroundColor('#0D9FFB').width('40%').onClick(() => {console.info(`Succeeded in clicking the 'Back' button.`)// 跳转到第二页router.pushUrl({ url: 'pages/Index' }).then(() => {console.info('Succeeded in jumping to the first page.')}).catch((err: BusinessError) => {console.error(`Failed to jump to the first page. Code is ${err.code}, message is ${err.message}`)})}).height("15%")}.width('100%')}.height('100%')}
}

6、实现效果

第一个界面Index:

在这里插入图片描述

第二个界面second:

在这里插入图片描述

build运行

在Previewer运行时,如果代码出现问题,并不会运行失败,而是界面不重新刷新

解决方案:在Build -> Rebuild Project中重构代码,出现错误会提示

http://www.zhongyajixie.com/news/49563.html

相关文章:

  • 做现金贷网站的公司抖音关键词排名系统
  • wordpress 360网盘seo网站优化推广教程
  • 我想做一个小网站搞页游该怎么做广州seo营销培训
  • 面对面视频 网站开发网站关键词排名
  • 网站建设要多少钱简述如何对网站进行推广
  • 贵州省住房和城乡建设厅网网站网站广告制作
  • 彩票网站怎么做推广海口关键词优化报价
  • 个人网站备案流程新东方在线koolearn
  • 响应式网站做优化好吗正规手游代理平台有哪些
  • 如何介绍自己的网站爱战网关键词
  • seo网站推广电话网络营销的发展概述
  • 宁波网站建设ysdsh站长工具查询网站信息
  • 为什么资讯网站荣誉被收录店铺数据分析主要分析什么
  • 做后期的网站外贸企业网站设计公司
  • go语言 做网站app下载推广平台
  • 手机网站 自适应金戈西地那非片
  • 做公司网站需要会什么合肥网站优化推广方案
  • 江门网站推广技巧付费seo优化入门教程
  • 网站开发融资什么关键词能搜到资源
  • 西安网站开发公司地址企业培训公司有哪些
  • 制作小程序网站源码磁力bt种子搜索
  • 建设银行网站用户名是什么意思aso关键词覆盖优化
  • 做油漆稀料用哪个网站软件关键词排名
  • 手机app开发公司哪家好优化大师win10能用吗
  • wordpress顶部通知栏公告宁波seo智能优化
  • 如何做垂直门户网站免费云服务器
  • 建设电影网站舆情网站直接打开的软件
  • 天津网站建设交换友情链接的渠道
  • wordpress带会员vip主题四川网站seo
  • sql网站的发布流程怎么快速推广app