refactor(client): refactor dialog functions to improve type inference
This commit is contained in:
parent
63415f1074
commit
ea9aeef9d8
84 changed files with 415 additions and 460 deletions
|
|
@ -57,26 +57,18 @@ export default defineComponent({
|
|||
|
||||
methods: {
|
||||
async rename() {
|
||||
const { canceled, result: title } = await os.dialog({
|
||||
const { canceled, result: title } = await os.inputText({
|
||||
title: 'Enter title',
|
||||
input: {
|
||||
type: 'text',
|
||||
default: this.value.title
|
||||
},
|
||||
showCancelButton: true
|
||||
default: this.value.title
|
||||
});
|
||||
if (canceled) return;
|
||||
this.value.title = title;
|
||||
},
|
||||
|
||||
async add() {
|
||||
const { canceled, result: type } = await os.dialog({
|
||||
type: null,
|
||||
const { canceled, result: type } = await os.select({
|
||||
title: this.$ts._pages.chooseBlock,
|
||||
select: {
|
||||
groupedItems: this.getPageBlockList()
|
||||
},
|
||||
showCancelButton: true
|
||||
groupedItems: this.getPageBlockList()
|
||||
});
|
||||
if (canceled) return;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue