W3Cschool
恭喜您成為首批注冊用戶
獲得88經驗值獎勵
{"name": "system.shortcut"}
import shortcut from '@system.shortcut'
或
const shortcut = require('@system.shortcut')
獲取桌面圖標是否創(chuàng)建
參數(shù)名 | 類型 | 必填 | 說明 |
---|---|---|---|
success | Function | 否 | 成功回調。參數(shù):true 已創(chuàng)建,false 未創(chuàng)建 |
fail | Function | 否 | 失敗回調 |
complete | Function | 否 | 執(zhí)行結束后的回調 |
shortcut.hasInstalled({
success: function () {
console.log('handling success')
}
})
創(chuàng)建桌面圖標,每次創(chuàng)建都需要用戶授權
創(chuàng)建桌面圖標
參數(shù)名 | 類型 | 必填 | 說明 |
---|---|---|---|
success | Function | 否 | 成功回調 |
fail | Function | 否 | 失敗回調 |
complete | Function | 否 | 執(zhí)行結束后的回調 |
錯誤碼 | 說明 |
---|---|
201 | 用戶拒絕,獲取創(chuàng)建桌面圖標權限失敗 |
shortcut.install({
success: function () {
console.log('handling success')
}
})
名稱 | 參數(shù)類型 | 是否可讀 | 是否可寫 | 描述 |
---|---|---|---|---|
systemPromptEnabled 1020+ | Boolean | 是 | 是 | 是否開啟系統(tǒng)快捷方式創(chuàng)建彈窗,默認 true。不會持久化,只對當前運行有效 |
shortcut.systemPromptEnabled = false
let enabled = shortcut.systemPromptEnabled
console.log('system prompt enabled: ' + enabled)
禁止使用。
后臺運行詳細用法參見 后臺運行腳本。
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: