[英]Node Webkit -Save As dialog with multiple option on "Save as Type" field
您需要做的是为您要显示的每个选项提供不同的“描述”和“接受”。这样,另存为对话框将向您显示选项,您可以使用该源保存文件。
const opts = await window.showSaveFilePicker({
types: [{
description: 'Web Page,
complete(*.htm;*.html)',
accept: {
'file/*':['.html']
}
},
{
description:'Web Page,
complete(*.htm;*.html)',
accept: {
'file/*': ['.html'],
},
{
description: 'Web Page,
HTML only(*.htm,*.html)'
accept: {
'file/*': ['.html'],
},
{
description: 'Text File
(*.text,*.text)
HTML only(*.htm,*.html)'
accept: {
'file/*': ['.txt'],
},
}],
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.