|
@@ -55,7 +55,7 @@ function customDialogBuilder<T>(option: ListOptions<T>, dialogTag: string) {
|
|
|
topRight: 10
|
|
|
})
|
|
|
.visibility(option.title ? Visibility.Visible : Visibility.None)
|
|
|
- Column(){
|
|
|
+ Column() {
|
|
|
List() {
|
|
|
ForEach(option.values, (item: T, index: number) => {
|
|
|
ListItem() {
|
|
@@ -96,7 +96,7 @@ function customDialogBuilder<T>(option: ListOptions<T>, dialogTag: string) {
|
|
|
}) // 每行之间的分界线
|
|
|
.edgeEffect(EdgeEffect.Spring) // 边缘效果设置为Spring
|
|
|
.width('100%')
|
|
|
- .height(option.values === undefined ? '20%' :option.values.length < 5 ? option.values.length*60 : 300)
|
|
|
+ .height(option.values === undefined ? '20%' : option.values.length < 5 ? option.values.length * 60 : 300)
|
|
|
|
|
|
if (option.cancel) {
|
|
|
Column() {
|
|
@@ -225,18 +225,18 @@ export class ToolsHelper {
|
|
|
title: options.title,
|
|
|
message: options.msg,
|
|
|
buttons: [{
|
|
|
- text: options.confirm?.text ?? "确定",
|
|
|
- color: options.confirm?.color ?? "#000000",
|
|
|
- }, {
|
|
|
text: options.cancel?.text ?? "取消",
|
|
|
color: options.cancel?.color ?? "#666666",
|
|
|
- }]
|
|
|
+ }, {
|
|
|
+ text: options.confirm?.text ?? "确定",
|
|
|
+ color: options.confirm?.color ?? "#000000",
|
|
|
+ },]
|
|
|
})
|
|
|
.then((data) => {
|
|
|
if (data.index === 0) {
|
|
|
- options.confirm?.onClick && options.confirm.onClick()
|
|
|
- } else {
|
|
|
options.cancel?.onClick && options.cancel.onClick()
|
|
|
+ } else {
|
|
|
+ options.confirm?.onClick && options.confirm.onClick()
|
|
|
}
|
|
|
})
|
|
|
.catch((err: Error) => {
|