当前位置: 首页 > 文档资料 > Electron 中文文档 >

JumpListItem 对象

优质
小牛编辑
128浏览
2023-12-01
  • type 字符串 (可选)-以下之一:

    • task-任务将启动具有特定参数的应用程序。
    • separator-可用于分隔标准 Tasks 类别中的项目。
    • file-一个文件的链接将使用创建跳转列表的应用程序打开文件, 为此, 应用程序必须注册为该文件类型的默认程序 (尽管它并不需要成为默认程序)。
  • pathString (可选)-要打开的文件的路径, 只应在 typefile 时设置。
  • programString (可选)-要执行的程序的路径, 通常应该指定打开当前程序的 process.execPath。 只应在 typetask 时设置。
  • args 字符串 (可选) - 程序执行时的命令行参数。只应在 typetask 时设置。
  • titleString (可选)-要为跳转列表中的项显示的文本。只应在 typetask 时设置。
  • description String (optional) - 任务描述 (会以浮动提示的方式显示). 只应在typetask时设置.
  • 图标路径 字符串 (可选项) - 在跳转列表中会显示一个使用绝对路径的图标,它可以是一个包含图标的任意资源文件 (e.g. .ico, .exe, .dll). 通常可以指定process.execPath值显示程序图标。
  • iconIndex Number (可选) - 图标在资源文件中的索引值。 如果资源文件包含多个图标,则可以使用此值指示从零开始的图标索引,用于此任务的显示。 如果资源文件只包含一个图标,则iconIndex必须设为0。
  • workingDirectory String (optional) - The working directory. Default is empty.

JumpListItem Object

  • type String (optional) - One of the following:

    • task - A task will launch an app with specific arguments.
    • separator - Can be used to separate items in the standard Tasks category.
    • file - A file link will open a file using the app that created the Jump List, for this to work the app must be registered as a handler for the file type (though it doesn't have to be the default handler).
  • path String (optional) - Path of the file to open, should only be set if type is file.
  • program String (optional) - Path of the program to execute, usually you should specify process.execPath which opens the current program. Should only be set if type is task.
  • args String (optional) - The command line arguments when program is executed. Should only be set if type is task.
  • title String (optional) - The text to be displayed for the item in the Jump List. Should only be set if type is task.
  • description String (optional) - Description of the task (displayed in a tooltip). Should only be set if type is task.
  • iconPath String (optional) - The absolute path to an icon to be displayed in a Jump List, which can be an arbitrary resource file that contains an icon (e.g. .ico, .exe, .dll). You can usually specify process.execPath to show the program icon.
  • iconIndex Number (optional) - The index of the icon in the resource file. If a resource file contains multiple icons this value can be used to specify the zero-based index of the icon that should be displayed for this task. If a resource file contains only one icon, this property should be set to zero.
  • workingDirectory String (optional) - The working directory. Default is empty.