提交 ee130ca9 编写于 作者: Z zhangshuqi
上级 c7934d6b
@Entry
@Component
struct navigationType {
@State strokeWidthStr: string = '10px'
@State dividerColorStr: string = '#000000'
@State startMarginStr: string = '5px'
@State endMarginStr: string = '5px'
@State nullFlag: boolean = false
@State dividerColor: Color = Color.Red
private arr: number[] = [1, 2, 3];
normalIcon : Resource = $r("app.media.icon")
selectedIcon: Resource = $r("app.media.icon")
build() {
Column() {
Navigation() {
TextInput({ placeholder: 'search...' })
.width("90%")
.height(40)
.backgroundColor('#FFFFFF')
List({ space: 12 }) {
ForEach(this.arr, (item) => {
ListItem() {
NavRouter() {
Text("NavRouter" + item)
.width("100%")
.height(72)
.backgroundColor('#FFFFFF')
.borderRadius(24)
.fontSize(16)
.fontWeight(500)
.textAlign(TextAlign.Center)
NavDestination() {
Text("NavDestinationContent" + item)
}
.title("NavDestinationTitle" + item)
}
}
}, item => item)
}
.width("90%")
.margin({ top: 12 })
}.key("ArkUX_Navigation_1111")
.title("������������")
.titleMode(NavigationTitleMode.Mini)
.mode(NavigationMode.Auto)
.minContentWidth(50)
.navBarWidth(100)
.navBarWidthRange([50, 300])
}
.height('100%')
.width('100%')
.backgroundColor('#F1F3F5')
}
}
\ No newline at end of file
...@@ -593,6 +593,40 @@ export default function ApiCommponentAddJsunit() { ...@@ -593,6 +593,40 @@ export default function ApiCommponentAddJsunit() {
expect(obj.$attrs.margin).assertEqual('0.00vp'); expect(obj.$attrs.margin).assertEqual('0.00vp');
done(); done();
}); });
it('apiCommponentAddJsunit_2300', 0, async function (done) {
console.info("[apiCommponentAddJsunit_2300] START" );
ohosrouter.clear();
ohosrouter.pushUrl({
url: 'MainAbility/pages/navition3',
params: {
data1: 'message',
data2: {
data3: [123, 456, 789]
}
}
}).then(() => {
// success
}).catch(err => {
console.error(`pushUrl failed, code is ${err.code}, message is ${err.message}`);
})
await CommonFunc.sleep(1000);
let strJson = getInspectorByKey('ArkUX_Navigation_1111');
console.info('apiCommponentAddJsunit_2300 START :'+ JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("apiCommponentAddJsunit_2300 obj is: " + JSON.stringify(obj));
let mode = obj.$attrs.mode
let minContentWidth = obj.$attrs.minContentWidth
let navBarWidth = obj.$attrs.navBarWidth
let navBarWidthRange = obj.$attrs.navBarWidthRange
expect(mode).assertEqual("NavigationMode.AUTO");
expect(minContentWidth).assertEqual("50.00vp");
expect(navBarWidth).assertEqual("100.00vp");
expect(navBarWidthRange).assertEqual("50.00vp, 300.00vp");
console.info('apiCommponentAddJsunit_2300 END ');
done();
});
}) })
......
...@@ -89,6 +89,7 @@ ...@@ -89,6 +89,7 @@
"MainAbility/pages/RenderFit", "MainAbility/pages/RenderFit",
"MainAbility/pages/Xcomponent", "MainAbility/pages/Xcomponent",
"MainAbility/pages/RouteType1", "MainAbility/pages/RouteType1",
"MainAbility/pages/RouteType2" "MainAbility/pages/RouteType2",
"MainAbility/pages/navition3"
] ]
} }
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册