提交 4751adca 编写于 作者: B bayanxing

modify attribute code

Signed-off-by: Nbayanxing <bayanxing@kaihongdigi.com>
上级 dc6d3079
.doc-page {
flex-direction: column;
justify-content: center;
align-items: center;
margin-top: 50px;
}
.btn-div {
width: 100%;
height: 200px;
flex-direction: column;
align-items: center;
justify-content: center;
margin: 10px;
}
.btn {
background-color: brown;
margin: 10px;
}
.txt {
font-weight: bold;
font-size: 39px;
}
.dialog-main {
width: 500px;
height: 300px;
margin: 30px;
}
.dialog-div {
flex-direction: column;
align-items: center;
}
.inner-txt {
width: 400px;
height: 160px;
flex-direction: column;
align-items: center;
justify-content: space-around;
}
.inner-btn {
width: 400px;
height: 120px;
justify-content: space-around;
align-items: center;
}
.btn-txt {
background-color: brown;
}
/** /**
* Copyright (c) 2022 Shenzhen kaiHong Digital Industry Development Co., Ltd. * Copyright (c) 2022 Shenzhen kaiHong Digital Industry Development Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
......
<div class="doc-page">
<div class="btn-div">
<button type="capsule" value="Click show 样式" class="btn" onclick="showDialog1"></button>
<button type="capsule" value="Click show 通用属性1" class="btn" onclick="showDialog2"></button>
<button type="capsule" value="Click show 通用属性2" class="btn" onclick="showDialog3"></button>
<button type="capsule" value="Click show 特有属性" class="btn" onclick="showDialog4"></button>
<button type="capsule" value="Click show 无障碍dialog" class="btn" onclick="showDialog5"></button>
</div>
<dialog id="simpleDialog1" dragable="true" class="dialog-main" oncancel="cancelDialog">
<div class="dialog-div">
<div class="inner-txt">
<text class="txt" ondoubleclick="doubleClick">Simple dialog</text>
</div>
<div class="inner-btn">
<button type="capsule" value="Cancel" onclick="cancelSchedule" class="btn-txt"></button>
<button type="capsule" value="Confirm" onclick="setSchedule" class="btn-txt"></button>
</div>
</div>
</dialog>
<dialog id="simpleDialog2" dragable="false" class="dialog-main" oncancel="cancelDialog"
focusable ="true"
data-name ="prop1" click-effect="spring-medium"
dir ="rtl"
style="width: 100%; height: 300px;">
<div class="dialog-div">
<div class="inner-txt">
<text class="txt" ondoubleclick="doubleClick">dialog通用属性1</text>
</div>
<div class="inner-btn">
<button type="capsule" value="Cancel" onclick="cancelSchedule" class="btn-txt"></button>
<button type="capsule" value="Confirm" onclick="setSchedule" class="btn-txt"></button>
</div>
</div>
</dialog>
<dialog id="simpleDialog3" dragable="false" class="dialog-main" oncancel="cancelDialog"
ref ="prop2"
focusable ="false"
data-name ="prop2" click-effect="spring-large"
dir ="ltr"
style="width: 100%; height: 300px;">
<div class="dialog-div">
<div class="inner-txt">
<text class="txt" ondoubleclick="doubleClick">dialog通用属性2</text>
</div>
<div class="inner-btn">
<button type="capsule" value="Cancel" onclick="cancelSchedule" class="btn-txt"></button>
<button type="capsule" value="Confirm" onclick="setSchedule" class="btn-txt"></button>
</div>
</div>
</dialog>
<dialog id="simpleDialog4" dragable="true" class="dialog-main" oncancel="cancelDialog">
<div class="dialog-div">
<div class="inner-txt">
<text class="txt" ondoubleclick="doubleClick">dialog特有属性</text>
</div>
<div class="inner-btn">
<button type="capsule" value="Cancel" onclick="cancelSchedule" class="btn-txt"></button>
<button type="capsule" value="Confirm" onclick="setSchedule" class="btn-txt"></button>
</div>
</div>
</dialog>
<dialog id="simpleDialog5" dragable="true" class="dialog-main" oncancel="cancelDialog"
accessibilitygroup ="true"
accessibilitytext="这是dialog"
accessibilitydescription="此处是dialog"
accessibilityimportance="no-hide-descendants">
<div class="dialog-div">
<div class="inner-txt">
<text class="txt" ondoubleclick="doubleClick">dialog无障碍</text>
</div>
<div class="inner-btn">
<button type="capsule" value="Cancel" onclick="cancelSchedule" class="btn-txt"></button>
<button type="capsule" value="Confirm" onclick="setSchedule" class="btn-txt"></button>
</div>
</div>
</dialog>
</div>
<!--/** <!--/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
......
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 prompt from '@system.prompt';
export default {
showDialog1() {
this.$element('simpleDialog1').show()
},
showDialog2() {
this.$element('simpleDialog2').show()
},
showDialog3() {
this.$element('simpleDialog3').show()
},
showDialog4() {
this.$element('simpleDialog3').show()
},
showDialog5() {
this.$element('simpleDialog5').show()
},
cancelDialog() {
prompt.showToast({
message: 'Dialog cancelled'
})
},
cancelSchedule() {
this.$element('simpleDialog1').close()
this.$element('simpleDialog2').close()
this.$element('simpleDialog3').close()
this.$element('simpleDialog4').close()
this.$element('simpleDialog5').close()
prompt.showToast({
message: 'Successfully cancelled'
})
},
setSchedule() {
this.$element('simpleDialog1').close()
this.$element('simpleDialog2').close()
this.$element('simpleDialog3').close()
this.$element('simpleDialog4').close()
this.$element('simpleDialog5').close()
prompt.showToast({
message: 'Successfully confirmed'
})
},
doubleClick(){
prompt.showToast({
message: 'doubleClick'
})
}
}
/** /**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册