@@ -35,6 +35,7 @@
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/favicon.png"/>
|
||||
<!-- 设置浏览器地址栏颜色(在 Android Chrome 特别明显)。-->
|
||||
<meta name="theme-color" content="#818CF8"/>
|
||||
<link rel="manifest" href="/manifest.json">
|
||||
|
||||
<!-- 阻止 iOS 自动把数字识别为电话号码。-->
|
||||
<!-- HandheldFriendly 和 MobileOptimized 是旧手机浏览器的优化提示(现在作用不大)。-->
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<title>Type Words 官网 - 词文记 | 单词跟打 · 文章跟打</title>
|
||||
@@ -35,6 +35,7 @@
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/favicon.png" />
|
||||
<!-- 设置浏览器地址栏颜色(在 Android Chrome 特别明显)。-->
|
||||
<meta name="theme-color" content="#818CF8" />
|
||||
<link rel="manifest" href="/manifest.json">
|
||||
|
||||
<!-- 阻止 iOS 自动把数字识别为电话号码。-->
|
||||
<!-- HandheldFriendly 和 MobileOptimized 是旧手机浏览器的优化提示(现在作用不大)。-->
|
||||
|
||||
13
src/main.ts
13
src/main.ts
@@ -23,3 +23,16 @@ app.directive('opacity', (el, binding) => {
|
||||
app.directive('loading', loadingDirective)
|
||||
|
||||
app.mount('#app')
|
||||
|
||||
// 注册Service Worker(pwa支持)
|
||||
if ('serviceWorker' in navigator) {
|
||||
window.addEventListener('load', () => {
|
||||
navigator.serviceWorker.register('/service-worker.js')
|
||||
.then(registration => {
|
||||
console.log('ServiceWorker registration successful with scope: ', registration.scope);
|
||||
})
|
||||
.catch(err => {
|
||||
console.log('ServiceWorker registration failed: ', err);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user