我在TypeScript中有这个类型定义:
export type xhrTypes = "GET" | "POST" | "PUT" | "DELETE" | "OPTIONS" | "CONNECT" | "HEAD";
Run Code Online (Sandbox Code Playgroud)
遗憾的是,这是区分大小写的...有没有办法定义它不区分大小写?
谢谢
我正在尝试显示通知,并在单击时做一些事情。
try {
navigator.serviceWorker.getRegistration()
.then(reg => {
reg.showNotification("Guarda il videoclip!", {
body: "clicca qua!",
icon: "images/she_is_fire.png",
vibrate: [100, 50, 100],
tag: 'sample',
actions: [{ action: 'explore', title: 'Guarda', icon: 'images/she_is_fire.png' }],
});
self.addEventListener('notificationclick', function(event) {
event.notification.close();
window.open("https://youtu.be/PAvHeRGZ_lA");
}, false);
})
.catch(err => alert('Service Worker registration error: ' + err));
} catch (err) {
alert('Notification API error: ' + err);
}
Run Code Online (Sandbox Code Playgroud)
我添加了事件监听器,但从未触发。
我究竟做错了什么?
我正在用C#linq查询。
选择并保存查询后,我必须对它进行排序并接受15行...
var query = from a
[...]
select new
{
a.id,
a.desc,
}
[...]
Run Code Online (Sandbox Code Playgroud)
这样做之间有什么区别吗?
return query.OrderByDescending(o => o.id).Take(15);
Run Code Online (Sandbox Code Playgroud)
和这个?
return query.Take(15).OrderByDescending(o => o.id);
Run Code Online (Sandbox Code Playgroud)
非常感谢你!