添加输入组件测试
This commit is contained in:
@@ -24,6 +24,12 @@ struct Index {
|
||||
{ name: "TcpSocket", page: 'pages/net/TcpSocketPage'}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'Component',
|
||||
items: [
|
||||
{name: 'InputPage', page: 'pages/component/InputPage'}
|
||||
]
|
||||
},
|
||||
// 布局
|
||||
{
|
||||
name: 'Layout',
|
||||
@@ -126,7 +132,7 @@ struct Index {
|
||||
Column() {
|
||||
Row() {
|
||||
Text(item.name);
|
||||
Image(CommonRes.getImageRes(CommonRes.IC_CHEVRON_RIGHT)).width(32).height(32);
|
||||
Image(CommonRes.getImage(CommonRes.IC_CHEVRON_RIGHT)).width(32).height(32);
|
||||
}.width('100%').height(48).justifyContent(FlexAlign.SpaceBetween).alignItems(VerticalAlign.Center)
|
||||
.padding({left: 16, right: 16})
|
||||
Divider().margin({ top: 2 });
|
||||
|
35
app/src/main/ets/pages/component/InputPage.ets
Normal file
35
app/src/main/ets/pages/component/InputPage.ets
Normal file
@@ -0,0 +1,35 @@
|
||||
import { CommonRes, PhoneInput } from '@devwiki/common_ui/Index';
|
||||
|
||||
@Entry
|
||||
@Component
|
||||
struct InputPage {
|
||||
|
||||
@Builder settingItem() {
|
||||
Button() {
|
||||
Flex({
|
||||
justifyContent: FlexAlign.SpaceBetween,
|
||||
alignItems: ItemAlign.Center
|
||||
}) {
|
||||
Text("AppAbility_label").fontSize(14)
|
||||
|
||||
Row() {
|
||||
Text("hint").margin({right: CommonRes.getFloat('size_4vp')})
|
||||
.fontSize(14)
|
||||
|
||||
Image(CommonRes.getImage('ic_chevron_left')).height(24).width(24);
|
||||
}
|
||||
}.width('100%')
|
||||
.padding({
|
||||
top: 16,
|
||||
bottom: 16
|
||||
})
|
||||
}.type(ButtonType.Normal).width('100%').backgroundColor(Color.Red)
|
||||
}
|
||||
|
||||
build() {
|
||||
Column(){
|
||||
this.settingItem()
|
||||
Text("123")
|
||||
}.width('100%').height('100%')
|
||||
}
|
||||
}
|
16
app/src/main/ets/pages/component/SVGPage.ets
Normal file
16
app/src/main/ets/pages/component/SVGPage.ets
Normal file
@@ -0,0 +1,16 @@
|
||||
import { CommonRes } from '@devwiki/common_ui/Index'
|
||||
|
||||
@Entry
|
||||
@Component
|
||||
export struct SVGPage {
|
||||
build() {
|
||||
Column() {
|
||||
Text().width(96).height(96).backgroundColor($r('app.media.ic_eye_off'))
|
||||
.linearGradient({
|
||||
angle: 90,
|
||||
colors: [[0xff0000, 0.0], [0x0000ff, 0.3], [0xffff00, 1.0]],
|
||||
repeating: true
|
||||
})
|
||||
}.height('100%').justifyContent(FlexAlign.Center)
|
||||
}
|
||||
}
|
1
app/src/main/resources/base/media/ic_eye_off.svg
Normal file
1
app/src/main/resources/base/media/ic_eye_off.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>eye-off</title><path d="M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z" /></svg>
|
After Width: | Height: | Size: 677 B |
@@ -5,6 +5,7 @@
|
||||
"pages/web/WebDialogPage",
|
||||
"pages/layout/LinearLayoutPage",
|
||||
"pages/layout/RelativeContainerPage",
|
||||
"pages/component/InputPage",
|
||||
"pages/animation/CompTransitionPage",
|
||||
"pages/media/AVPlayerPage",
|
||||
"pages/system/SchemePage",
|
||||
|
Reference in New Issue
Block a user