未验证 提交 4a22258b 编写于 作者: O openharmony_ci 提交者: Gitee

!14100 修改ts-tabs组件通用属性描述

Merge pull request !14100 from 田雨/master
......@@ -17,6 +17,8 @@ js侧通过`import`引入native侧包含处理js逻辑的so,如:`import hell
### so命名规则
**so命名必须符合以下规则:**
* 每个模块对应一个so。
* 如模块名为`hello`,则so的名字为`libhello.so``napi_module``nm_modname`字段应为`hello`,大小写与模块名保持一致,应用使用时写作:`import hello from 'libhello.so'`
......
......@@ -119,7 +119,7 @@ export default class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage) {
// storage作为参数传递给loadContent接口
windowStage.loadContent('pages/index', this.storage)
windowStage.loadContent('pages/Index', this.storage)
}
onWindowStageDestroy() {
......@@ -139,7 +139,7 @@ export default class EntryAbility extends UIAbility {
@Component组件获取数据
```ts
// index.ets
// Index.ets
let storage = LocalStorage.GetShared()
@Entry(storage)
......
......@@ -494,7 +494,7 @@ struct CompA {
this.updateTotal()
}
updateTotal(): number {
updateTotal(): void {
let sum = 0;
this.shopBasket.forEach((i) => {
sum += i
......
......@@ -37,10 +37,10 @@ create(options: AnimatorOptions): AnimatorResult
```js
let options = {
duration: 1500,
easing: 'friction',
easing: "friction",
delay: 0,
fill: 'forwards',
direction: 'normal',
fill: "forwards",
direction: "normal",
iterations: 3,
begin: 200.0,
end: 400.0
......@@ -80,10 +80,10 @@ reset(options: AnimatorOptions): void
```js
let options = {
duration: 1500,
easing: 'friction',
easing: "friction",
delay: 0,
fill: 'forwards',
direction: 'normal',
fill: "forwards",
direction: "normal",
iterations: 3,
begin: 200.0,
end: 400.0
......@@ -99,7 +99,7 @@ try {
play(): void
启动动画。
启动动画。动画会保留上一次的播放状态,比如播放状态设置reverse后,再次播放会保留reverse的播放状态。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
......@@ -247,16 +247,16 @@ animatorResult.onrepeat = function() {
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
| 名称 | 类型 | 必填 | 说明 |
| ---------- | ---------------------------------------- | ---- | ---------------------------------------- |
| duration | number | 是 | 动画播放的时长,单位毫秒,默认为0。 |
| easing | string | 是 | 动画插值曲线,默认为'ease'。 |
| delay | number | 是 | 动画延时播放时长,单位毫秒,默认为0,即不延时。 |
| fill | "none" \| "forwards" \| "backwards" \| "both" | 是 | 动画执行后是否恢复到初始状态,默认值为"none"。动画执行后,动画结束时的状态(在最后一个关键帧中定义)将保留。 |
| direction | "normal" \| "reverse" \| "alternate" \| "alternate-reverse" | 是 | 动画播放模式,默认值"normal"。 |
| iterations | number | 是 | 动画播放次数,默认值1。设置为0时不播放,设置为-1时无限次播放。 |
| begin | number | 是 | 动画插值起点,默认为0。 |
| end | number | 是 | 动画插值终点,默认为1。 |
| 名称 | 类型 | 必填 | 说明 |
| ---------- | ----------------------------------------------------------- | ---- | ------------------------------------------------------------ |
| duration | number | 是 | 动画播放的时长,单位毫秒。 |
| easing | string | 是 | 动画插值曲线,仅支持以下可选值:<br/>"linear":动画线性变化。<br/>"ease":动画开始和结束时的速度较慢,cubic-bezier(0.25、0.1、0.25、1.0)。<br/>"ease-in":动画播放速度先慢后快,cubic-bezier(0.42, 0.0, 1.0, 1.0)。<br/>"ease-out":动画播放速度先快后慢,cubic-bezier(0.0, 0.0, 0.58, 1.0)。<br/>"ease-in-out":动画播放速度先加速后减速,cubic-bezier(0.42, 0.0, 0.58, 1.0)。<br/>"fast-out-slow-in":标准曲线,cubic-bezier(0.4,0.0,0.2,1.0)。<br/>"linear-out-slow-in":减速曲线,cubic-bezier(0.0,0.0,0.2,1.0)。<br/>"friction":阻尼曲线,cubic-bezier(0.2, 0.0, 0.2, 1.0)。<br/>"extreme-deceleration":急缓曲线,cubic-bezier(0.0, 0.0, 0.0, 1.0)。<br/>"rhythm":节奏曲线,cubic-bezier(0.7, 0.0, 0.2, 1.0)。<br/>"sharp":锐利曲线,cubic-bezier(0.33, 0.0, 0.67, 1.0)。<br/>"smooth":平滑曲线,cubic-bezier(0.4, 0.0, 0.4, 1.0)。<br/>cubic-bezier(x1, y1, x2, y2):在三次贝塞尔函数中定义动画变化过程,入参的值必须处于0-1之间。<br/>steps(number, step-position):阶梯曲线。number必须设置,支持的类型为int。step-position参数可选,支持设置start或end,默认值为end。 |
| delay | number | 是 | 动画延时播放时长,单位毫秒,设置为0时,表示不延时。 |
| fill | "none" \| "forwards" \| "backwards" \| "both" | 是 | 动画执行后是否恢复到初始状态,动画执行后,动画结束时的状态(在最后一个关键帧中定义)将保留。<br/>"none":在动画执行之前和之后都不会应用任何样式到目标上。<br/>"forwards":在动画结束后,目标将保留动画结束时的状态(在最后一个关键帧中定义)。<br/>"backwards":动画将在animation-delay期间应用第一个关键帧中定义的值。当animation-direction为"normal"或"alternate"时应用from关键帧中的值,当animation-direction为"reverse"或"alternate-reverse"时应用to关键帧中的值。<br/>"both":动画将遵循forwards和backwards的规则,从而在两个方向上扩展动画属性。 |
| direction | "normal" \| "reverse" \| "alternate" \| "alternate-reverse" | 是 | 动画播放模式。<br/>"normal": 动画正向循环播放。<br/>"reverse": 动画反向循环播放。<br/>"alternate":动画交替循环播放,奇数次正向播放,偶数次反向播放。<br/>"alternate-reverse":动画反向交替循环播放,奇数次反向播放,偶数次正向播放。 |
| iterations | number | 是 | 动画播放次数。设置为0时不播放,设置为-1时无限次播放。<br/>**说明:**设置为除-1外其他负数视为无效取值,无效取值动画默认播放1次。 |
| begin | number | 是 | 动画插值起点。 |
| end | number | 是 | 动画插值终点。 |
## 完整示例
......@@ -280,10 +280,10 @@ export default {
onInit() {
let options = {
duration: 1500,
easing: 'friction',
easing: "friction",
delay: 0,
fill: 'forwards',
direction: 'normal',
fill: "forwards",
direction: "normal",
iterations: 2,
begin: 200.0,
end: 400.0
......@@ -293,9 +293,9 @@ export default {
Show() {
let options1 = {
duration: 1500,
easing: 'friction',
easing: "friction",
delay: 0,
fill: 'forwards',
fill: "forwards",
direction: "normal",
iterations: 2,
begin: 0,
......@@ -336,10 +336,10 @@ struct AnimatorTest {
let _this = this
this.backAnimator = animator.create({
duration: 2000,
easing: 'ease',
easing: "ease",
delay: 0,
fill: 'none',
direction: 'normal',
fill: "none",
direction: "normal",
iterations: 1,
begin: 100,
end: 200
......@@ -444,10 +444,10 @@ struct AnimatorTest {
this.flag = false
this.backAnimator.reset({
duration: 5000,
easing: 'ease-in',
easing: "ease-in",
delay: 0,
fill: 'none',
direction: 'normal',
fill: "none",
direction: "normal",
iterations: 4,
begin: 100,
end: 300
......@@ -513,10 +513,10 @@ createAnimator(options: AnimatorOptions): AnimatorResult
```js
let options = {
duration: 1500,
easing: 'friction',
easing: "friction",
delay: 0,
fill: 'forwards',
direction: 'normal',
fill: "forwards",
direction: "normal",
iterations: 3,
begin: 200.0,
end: 400.0,
......
......@@ -100,13 +100,13 @@ router.pushUrl({
data3: [123, 456, 789]
}
}
})
.then(() => {
// success
})
.catch(err => {
}, (err) => {
if (err) {
console.error(`pushUrl failed, code is ${err.code}, message is ${err.message}`);
})
return;
}
console.info('pushUrl success');
})
```
## router.pushUrl<sup>9+</sup>
......@@ -573,7 +573,7 @@ router.getParams();
| 名称 | 说明 |
| -------- | ------------------------------------------------------------ |
| Standard | 标准模式。 <br/>目标页面会被添加到页面路由栈顶,无论栈中是否存在相同url的页面。 |
| Standard | 标准模式。 <br/>目标页面会被添加到页面路由栈顶,无论栈中是否存在相同url的页面。<br/>**说明:**不使用路由跳转模式时,按标准模式跳转。 |
| Single | 单实例模式。<br/>如果目标页面的url在页面栈中已经存在同url页面,离栈顶最近的页面会被移动到栈顶,移动后的页面为新建页。<br/>如目标页面的url在页面栈中不存在同url页面,按标准模式跳转。 |
## 完整示例
......
......@@ -83,7 +83,7 @@ struct ImageAnimatorExample {
}
])
.duration(2000)
.state(this.state).reverse(this.reverse).fixedSize(false)
.state(this.state).reverse(this.reverse)
.fillMode(FillMode.None).iterations(this.iterations).width(340).height(240)
.margin({ top: 100 })
.onStart(() => {
......
......@@ -39,9 +39,10 @@ Rating(options?: { rating: number, indicator?: boolean })
| -------- | -------- |
| onChange(callback:(value:&nbsp;number)&nbsp;=&gt;&nbsp;void) | 操作评分条的评星发生改变时触发该回调。 |
## 示例
### 示例1
```ts
// xxx.ets
@Entry
......@@ -95,3 +96,37 @@ struct RatingExample {
```
![rating](figures/rating.gif)
### 示例2
```ts
// xxx.ets
@Entry
@Component
struct RatingExample {
@State rating: number = 3.5
build() {
Column() {
Rating({ rating: this.rating, indicator: false })
.stars(5)
.stepSize(0.5)
.starStyle({
backgroundUri: '/common/imag1.png', // common目录与pages同级
foregroundUri: '/common/imag2.png',
secondaryUri: '/common/imag3.png'
})
.margin({ top: 24 })
.onChange((value: number) => {
this.rating = value
})
Text('current score is ' + this.rating)
.fontSize(16)
.fontColor('rgba(24,36,49,0.60)')
.margin({ top: 16 })
}.width('100%').height('100%').backgroundColor('#F1F3F5')
}
}
```
![rating1](figures/rating1.gif)
\ No newline at end of file
......@@ -87,7 +87,7 @@ struct SearchExample {
.searchButton('SEARCH')
.width(400)
.height(40)
.backgroundColor(Color.White)
.backgroundColor('#F5F5F5')
.placeholderColor(Color.Grey)
.placeholderFont({ size: 14, weight: 400 })
.textFont({ size: 14, weight: 400 })
......
......@@ -75,7 +75,7 @@ struct TextTimerExample {
build() {
Column() {
TextTimer({ controller: this.textTimerController, isCountDown: true, count: 30000 })
TextTimer({ isCountDown: true, count: 30000, controller: this.textTimerController })
.format(this.format)
.fontColor(Color.Black)
.fontSize(50)
......
......@@ -101,8 +101,7 @@ struct ListItemExample2 {
Column() {
List({space:10}) {
ListItem() {
Text(this.message) {
}
Text(this.message)
.width('100%')
.height(100)
.fontSize(16)
......@@ -113,8 +112,7 @@ struct ListItemExample2 {
.swipeAction({ end:this.itemEnd})
ListItem() {
Text(this.message) {
}
Text(this.message)
.width('100%')
.height(100)
.fontSize(16)
......
......@@ -133,7 +133,7 @@ scrollToIndex(value: number): void
> **说明:**
>
> 仅支持Grid、list、WaterFlow组件。
> 仅支持Grid、list组件。
**参数:**
......
......@@ -29,7 +29,6 @@ TabContent()
> **说明:**
> - TabContent组件不支持设置通用宽度属性,其宽度默认撑满Tabs父组件。
> - TabContent组件不支持设置通用高度属性,其高度由Tabs父组件高度与TabBar组件高度决定。
> - TabContent组件不支持[触摸热区设置](ts-universal-attributes-touch-target.md)。
## SubTabBarStyle<sup>9+</sup>
......
......@@ -34,7 +34,7 @@ Tabs(value?: {barPosition?: BarPosition, index?: number, controller?: [TabsContr
## 属性
不支持[触摸热区设置](ts-universal-attributes-touch-target.md)除支持[通用属性](ts-universal-attributes-size.md)外,还支持以下属性:
除支持[通用属性](ts-universal-attributes-size.md)外,还支持以下属性:
| 名称 | 参数类型 | 描述 |
| -------- | -------- | -------- |
......
......@@ -8,7 +8,7 @@ Grid用于设置网格布局相关参数,GridItem定义子组件相关特征
2. 支持自定义网格布局行数和列数,以及每行每列尺寸占比。
3. 支持设置网格布局中子组件的行列间距。
4. 支持设置子组件横跨几行或者几列。
## 容器组件Grid设置
......@@ -159,7 +159,7 @@ Grid() {
.fontSize(16)
.textAlign(TextAlign.Center)
.textStyle()
}.rowStart(2).rowEnd(3) // 5子组件从第二列到第三列
}.rowStart(2).rowEnd(3) // 5子组件从第二行到第三行
GridItem() {
Text('4')
......
......@@ -90,26 +90,27 @@ listener.on('change', onPortrait)
### 媒体特征(media-feature)
| 类型 | 说明 |
| ----------------- | ---------------------------------------- |
| height | 应用页面显示区域的高度。 |
| min-height | 应用页面显示区域的最小高度。 |
| max-height | 应用页面显示区域的最大高度。 |
| width | 应用页面显示区域的宽度。 |
| min-width | 应用页面显示区域的最小宽度。 |
| max-width | 应用页面显示区域的最大宽度。 |
| 类型 | 说明 |
| ----------------- | ------------------------------------------------------------ |
| height | 应用页面显示区域的高度。 |
| min-height | 应用页面显示区域的最小高度。 |
| max-height | 应用页面显示区域的最大高度。 |
| width | 应用页面显示区域的宽度。 |
| min-width | 应用页面显示区域的最小宽度。 |
| max-width | 应用页面显示区域的最大宽度。 |
| resolution | 设备的分辨率,支持dpi,dppx和dpcm单位。其中:<br/>-&nbsp; dpi表示每英寸中物理像素个数,1dpi≈0.39dpcm;<br/>-&nbsp; dpcm表示每厘米上的物理像素个数,1dpcm&nbsp;&nbsp; 2.54dpi;<br/>-&nbsp; dppx表示每个px中的物理像素数(此单位按96px=1英寸为基准,与页面中的px单位计算方式不同),1dppx&nbsp; =&nbsp; 96dpi。 |
| min-resolution | 设备的最小分辨率。 |
| max-resolution | 设备的最大分辨率。 |
| min-resolution | 设备的最小分辨率。 |
| max-resolution | 设备的最大分辨率。 |
| orientation | 屏幕的方向。<br/>可选值:<br/>-&nbsp; orientation:&nbsp; portrait(设备竖屏)<br/>-&nbsp; orientation:&nbsp; landscape(设备横屏) |
| device-height | 设备的高度。 |
| min-device-height | 设备的最小高度。 |
| max-device-height | 设备的最大高度。 |
| device-width | 设备的宽度。 |
| min-device-width | 设备的最小宽度。 |
| max-device-width | 设备的最大宽度。 |
| device-height | 设备的高度。 |
| min-device-height | 设备的最小高度。 |
| max-device-height | 设备的最大高度。 |
| device-width | 设备的宽度。 |
| device-type | 设备的类型。<br/>可选值:<br/>-&nbsp;default |
| min-device-width | 设备的最小宽度。 |
| max-device-width | 设备的最大宽度。 |
| round-screen | 屏幕类型,圆形屏幕为true,&nbsp; 非圆形屏幕为&nbsp; false。 |
| dark-mode | 系统为深色模式时为true,否则为false。 |
| dark-mode | 系统为深色模式时为true,否则为false。 |
## 场景示例
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册