本文整理汇总了TypeScript中open.default方法的典型用法代码示例。如果您正苦于以下问题:TypeScript open.default方法的具体用法?TypeScript open.default怎么用?TypeScript open.default使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类open
的用法示例。
在下文中一共展示了open.default方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: OpenUrl
//Use open for Windows and Mac, opener for Linux
public static OpenUrl(url: string) : void {
switch (process.platform) {
case "win32":
case "darwin":
open(url);
break;
default:
opener(url);
break;
}
}
示例2: open
.then(btn => {
if (!btn) { return; }
if (btn.title === msg.aboutOfficialApi) {
open(msg.urlOfficialApi);
} else if (btn.title === msg.seeReadme) {
open(msg.urlReadme);
}
}, (reason) => {
示例3: open
.then(btn => {
if (!btn) { return; }
if (btn.title === i18nManager.getMessage(LangResourceKeys.aboutOfficialApi)) {
open(i18nManager.getMessage(constants.urlOfficialApi));
} else if (btn.title === i18nManager.getMessage(LangResourceKeys.seeReadme)) {
open(i18nManager.getMessage(constants.urlReadme));
}
}, reason => {
示例4: switch
.then((choice) => {
switch (choice) {
case 'Download':
open('https://sourceforge.net/projects/nsis/');
break;
case 'Help':
open('http://superuser.com/a/284351/195953');
break;
}
});
示例5: function
app.listen(port, function(err) {
if (err) {
console.log(err);
} else {
open(`http://localhost:${port}`);
}
});
示例6: openResource
server.listen(PORT, () => {
const url = 'http://localhost:' + PORT + APP_BASE;
if (process.env.RESTART) {
console.log('Server restarted at: ', url);
} else {
openResource(url);
console.log('Server started at: ', url);
}
});
示例7: openResource
server.listen(Config.PORT, () =>
openResource('http://localhost:' + Config.PORT + Config.APP_BASE)
示例8: open
const openURL = (cmd: string): void => {
open(`https://idleberg.github.io/NSIS.docset/Contents/Resources/Documents/html/Reference/${cmd}.html?utm_source=vscode&utm_content=reference`);
};