text: import{_ as i,r as l,o as t,a as p,b as n,d as a,F as r,e,f as o}from"./app.2bf926e2.js";const d={},u=n("h2",{id:"\u4ECB\u7ECD",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#\u4ECB\u7ECD","aria-hidden":"true"},"#"),e(" \u4ECB\u7ECD")],-1),h=n("p",null,[n("code",null,"vuepress-plugin-pwa2"),e(" \u63D2\u4EF6\u9ED8\u8BA4\u7981\u7528\uFF0C\u63D0\u4F9B\u6E10\u8FDB\u5F0F\u7F51\u7EDC\u5E94\u7528\u7A0B\u5E8F\u652F\u6301\u3002")],-1),b=n("p",null,[n("code",null,"vuepress-theme-hope"),e(" \u5C06 "),n("code",null,"themeConfig.plugins.pwa"),e(" \u4F5C\u4E3A\u63D2\u4EF6\u9009\u9879\u4F20\u9012\u7ED9 "),n("code",null,"vuepress-plugin-pwa2"),e(" \u63D2\u4EF6\u3002")],-1),m={class:"custom-container tip"},f=n("p",{class:"custom-container-title"},"\u63D0\u793A",-1),k=e("\u4F60\u53EF\u4EE5\u8BBE\u7F6E "),_=n("code",null,"pwa: true",-1),g=e(" \u6765\u4EE5\u9ED8\u8BA4\u8BBE\u7F6E\u542F\u7528\u63D2\u4EF6\u3002"),x={class:"custom-container info"},v=n("p",{class:"custom-container-title"},"\u76F8\u5173\u4FE1\u606F",-1),w=e("\u6709\u5173\u66F4\u591A\u8BE6\u7EC6\u4FE1\u606F\uFF0C\u8BF7\u53C2\u89C1 "),q={href:"https://vuepress-theme-hope.github.io/v2/pwa/zh/config.html",target:"_blank",rel:"noopener noreferrer"},C=e("pwa2 \u63D2\u4EF6\u6587\u6863"),S=e("\u3002"),W=o('<h2 id="\u63D2\u4EF6\u9009\u9879" tabindex="-1"><a class="header-anchor" href="#\u63D2\u4EF6\u9009\u9879" aria-hidden="true">#</a> \u63D2\u4EF6\u9009\u9879</h2><h3 id="showinstall" tabindex="-1"><a class="header-anchor" href="#showinstall" aria-hidden="true">#</a> showInstall</h3><ul><li>\u7C7B\u578B: <code>boolean</code></li><li>\u9ED8\u8BA4\u503C: <code>true</code></li></ul><p>\u662F\u5426\u5728 Service Worker \u9996\u6B21\u6210\u529F\u6CE8\u518C\u65F6\u663E\u793A PWA \u5B89\u88C5\u6309\u94AE</p><h3 id="manifest" tabindex="-1"><a class="header-anchor" href="#manifest" aria-hidden="true">#</a> manifest</h3><ul><li>\u7C7B\u578B: <code>ManifestOption</code></li><li>\u5FC5\u586B: \u5426</li></ul><p>\u586B\u5145\u4E00\u4E2A\u5C06\u88AB\u89E3\u6790\u4E3A manifest.webmanifest \u7684\u5BF9\u8C61\u3002</p><div class="custom-container tip"><p class="custom-container-title">\u63D0\u793A</p><p>\u5982\u679C\u672A\u8BBE\u7F6E\u67D0\u4E9B\u9009\u9879\uFF0C\u5B83\u4EEC\u4F1A\u56DE\u9000\u5230\u63D2\u4EF6\u9884\u8BBE\u503C\u3002</p><ul><li><p>name: <code>siteConfig.title</code> || <code>siteConfig.locales[&#39;/&#39;].title</code> || <code>&#39;Site&#39;</code></p></li><li><p>short_name: <code>siteConfig.title</code> || <code>siteConfig.locales[&#39;/&#39;].title</code> || <code>&#39;Site&#39;</code></p></li><li><p>description: <code>siteConfig.description</code> || <code>siteConfig.locales[&#39;/&#39;].description</code> || <code>&#39;A site built with vuepress&#39;</code></p></li><li><p>lang: <code>siteConfig.locales[&#39;/&#39;].lang</code> || <code>themeConfig.locales[&#39;/&#39;].lang</code> || <code>&quot;en-US&quot;</code></p></li><li><p>start_url: <code>context.base</code></p></li><li><p>scope: <code>context.base</code></p></li><li><p>display: <code>&quot;standalone&quot;</code></p></li><li><p>theme_color: <code>&quot;#46bd87&quot;</code></p></li><li><p>background_color: <code>&#39;#ffffff&#39;</code></p></li><li><p>orientation: <code>&#39;portrait-primary&#39;</code></p></li><li><p>prefer_related_applications: <code>false</code></p></li></ul></div>',8),P={class:"custom-container info"},A=n("p",{class:"custom-container-title"},"\u66F4\u591A",-1),L=e("\u66F4\u591A\u5185\u5BB9\uFF0C\u8BF7\u8BE6\u89C1 "),z={href:"https://w3c.github.io/manifest/",target:"_blank",rel:"noopener noreferrer"},B=e("W3C Manifest"),y=o('<h3 id="favicon" tabindex="-1"><a class="header-anchor" href="#favicon" aria-hidden="true">#</a> favicon</h3><ul><li>\u7C7B\u578B: <code>string</code></li><li>\u5FC5\u586B: \u5426</li></ul><p><code>favicon.ico</code> \u5730\u5740\uFF0C\u586B\u5165\u7EDD\u5BF9\u8DEF\u5F84\u3002</p><div class="custom-container warning"><p class="custom-container-title">\u6CE8\u610F</p><p>\u6211\u4EEC\u5EFA\u8BAE\u4F60\u4E3A\u4F60\u7684\u7AD9\u70B9\u751F\u6210 favicon</p></div><h3 id="themecolor" tabindex="-1"><a class="header-anchor" href="#themecolor" aria-hidden="true">#</a> themeColor</h3><ul><li>\u7C7B\u578B: <code>string</code></li><li>\u9ED8\u8BA4\u503C: <code>&quot;#46bd87&quot;</code></li></ul><p>\u4E3B\u9898\u8272\uFF0C\u9ED8\u8BA4\u4E3A\u4E3B\u9898\u7EFF</p><h3 id="maxsize" tabindex="-1"><a class="header-anchor" href="#maxsize" aria-hidden="true">#</a> maxSize</h3><ul><li>\u7C7B\u578B: <code>number</code></li><li>\u9ED8\u8BA4\u503C: <code>2048</code></li></ul><p>\u5141\u8BB8\u7F13\u5B58\u7684\u6700\u5927\u5927\u5C0F (\u4EE5 KB \u4E3A\u5355\u4F4D)</p><div class="custom-container warning"><p class="custom-container-title">\u6CE8\u610F</p><p>\u6B64\u9009\u9879\u5177\u6709\u6700\u9AD8\u4F18\u5148\u7EA7\uFF0C\u4EFB\u4F55\u8D85\u8FC7\u6B64\u503C\u7684\u6587\u4EF6\u90FD\u4F1A\u88AB\u6392\u9664\u3002</p><p>\u6240\u4EE5\u4F60\u5982\u679C\u751F\u6210\u4E86\u5F88\u5927\u7684 HTML \u6216 JS \u6587\u4EF6\uFF0C\u8BF7\u8003\u8651\u8C03\u9AD8\u6B64\u503C\uFF0C\u5426\u5219\u4F60\u7684 PWA \u53EF\u80FD\u65E0\u6CD5\u5728\u79BB\u7EBF\u6A21\u5F0F\u4E0B\u6B63\u5E38\u8FD0\u884C\u3002</p></div><h3 id="cachehtml" tabindex="-1"><a class="header-anchor" href="#cachehtml" aria-hidden="true">#</a> cacheHTML</h3><ul><li>\u7C7B\u578B: <code>boolean</code></li><li>\u9ED8\u8BA4\u503C: <code>true</code></li></ul><p>\u662F\u5426\u7F13\u5B58\u4E3B\u9875\u548C 404 \u9519\u8BEF\u9875\u4E4B\u5916\u7684 HTML \u6587\u4EF6</p><h3 id="cachepic" tabindex="-1"><a class="header-anchor" href="#cachepic" aria-hidden="true">#</a> cachePic</h3><ul><li>\u7C7B\u578B: <code>boolean</code></li><li>\u9ED8\u8BA4\u503C: <code>false</code></li></ul><p>\u662F\u5426\u7F13\u5B58\u56FE\u7247\u3002</p><h3 id="maxpicsize" tabindex="-1"><a class="header-anchor" href="#maxpicsize" aria-hidden="true">#</a> maxPicSize</h3><ul><li>\u7C7B\u578B: <code>number</code></li><li>\u9ED8\u8BA4\u503C: <code>1024</code></li></ul><p>\u56FE\u7247\u5141\u8BB8\u7F13\u5B58\u7684\u6700\u5927\u5927\u5C0F (\u4EE5 KB \u4E3A\u5355\u4F4D)</p><div class="custom-container tip"><p class="custom-container-title">\u63D0\u793A</p><p>\u8BE5\u9009\u9879\u4E0D\u80FD\u5927\u4E8E <code>maxSize</code>\u3002</p></div><h3 id="apple" tabindex="-1"><a class="header-anchor" href="#apple" aria-hidden="true">#</a> apple</h3><p>\u9488\u5BF9\u82F9\u679C\u7684\u7279\u6B8A\u8BBE\u7F6E</p><blockquote><p>\u5982\u679C\u4F60\u4E0D\u60F3\u8FDB\u884C\u7CBE\u7EC6\u7684\u8BBE\u7F6E\uFF0C\u53EF\u4EE5\u5FFD\u7565\u5B83\uFF1B\u5982\u679C\u4F60\u4E0D\u60F3\u517C\u5BB9 Apple \u4E0A\u7684 Safari\uFF0C\u8BF7\u8BBE\u7F6E\u4E3A <code>false</code>\u3002</p></blockquote><h4 id="apple-icon" tabindex="-1"><a class="header-anchor" href="#apple-icon" aria-hidden="true">#</a> apple.icon</h4><ul><li>\u7C7B\u578B: <code>string</code></li><li>\u5FC5\u586B: \u5426</li></ul><p>\u586B\u5165\u82F9\u679C\u4F7F\u7528\u7684\u56FE\u6807\u5730\u5740\uFF0C\u63A8\u8350 152\xD7152 \u5927\u5C0F</p><h4 id="apple-statusbarcolor" tabindex="-1"><a class="header-anchor" href="#apple-statusbarcolor" aria-hidden="true">#</a> apple.statusBarColor</h4><ul><li>\u7C7B\u578B: <code>&quot;black&quot; | &quot;white&quot;</code></li><li>\u9ED8\u8BA4: <code>&quot;black&quot;</code></li></ul><p>\u82F9\u679C\u7684\u72B6\u6001\u680F\u989C\u8272</p><h4 id="apple-maskicon" tabindex="-1"><a class="header-anchor" href="#apple-maskicon" aria-hidden="true">#</a> apple.maskIcon</h4><ul><li>\u7C7B\u578B: <code>string</code></li><li>\u5FC5\u586B: \u5426</li></ul><p>Safari \u56FE\u6807</p><h3 id="mstile" tabindex="-1"><a class="header-anchor" href="#mstile" aria-hidden="true">#</a> msTile</h3><p>\u9488\u5BF9\u5FAE\u8F6F\u78C1\u8D34\u7684\u7279\u6B8A\u8BBE\u7F6E</p><blockquote><p>\u5982\u679C\u4F60\u4E0D\u60F3\u8FDB\u884C\u7CBE\u7EC6\u7684\u8BBE\u7F6E\uFF0C\u53EF\u4EE5\u5FFD\u7565\u5B83\uFF1B\u5982\u679C\u4F60\u4E0D\u60F3\u517C\u5BB9 windows\uFF0C\u8BF7\u8BBE\u7F6E\u4E3A <code>false</code>\u3002</p></blockquote><h4 id="mstile-image" tabindex="-1"><a class="header-anchor" href="#mstile-image" aria-hidden="true">#</a> msTile.image</h4><ul><li>\u7C7B\u578B: <code>string</code></li><li>\u5FC5\u586B: \u5426</li></ul><p>\u78C1\u8D34\u56FE\u6807</p><h4 id="mstile-color" tabindex="-1"><a class="header-anchor" href="#mstile-color" aria-hidden="true">#</a> msTile.color</h4><ul><li>\u7C7B\u578B: <code>string</code></li><li>\u9ED8\u8BA4\u503C: <code>themeColor</code></li></ul><p>\u78C1\u8D34\u989C\u8272\uFF0C\u7F3A\u7701\u4F1A\u81EA\u52A8\u56DE\u9000\u5230\u4E3B\u9898\u8272\u3002</p><h3 id="popupcomponent" tabindex="-1"><a class="header-anchor" href="#popupcomponent" aria-hidden="true">#</a> popupComponent</h3><ul><li>\u7C7B\u578B: <code>string</code></li><li>\u9ED8\u8BA4\u503C: <code>&#39;SWUpdatePopup&#39;</code></li></ul><p>\u53EF\u586B\u5165\u81EA\u5B9A\u4E49\u7684\u5F39\u7A97\u7EC4\u4EF6\u8DEF\u5F84\u3002</p><h3 id="generateswconfig" tabindex="-1"><a class="header-anchor" href="#generateswconfig" aria-hidden="true">#</a> generateSwConfig</h3>',46),I=e("\u4F20\u9012\u7ED9 "),T=n("code",null,"workbox-build",-1),M=e(" \u7684\u9009\u9879\uFF0C\u5177\u4F53\u8BE6\u60C5\uFF0C\u8BF7\u89C1 "),N={href:"https://developers.google.com/web/tools/workbox/reference-docs/latest/module-workbox-build#.generateSW",target:"_blank",rel:"noopener noreferrer"},V=e("Workbox \u6587\u6863"),E=o(`<h3 id="locales" tabindex="-1"><a class="header-anchor" href="#locales" aria-hidden="true">#</a> locales</h3><ul><li><p>\u7C7B\u578B: <code>PWALocaleConfig</code></p><div class="language-typescript ext-ts line-numbers-mode"><pre class="language-typescript"><code><span class="token keyword">interface</span> <span class="token class-name">PWALocaleData</span> <span class="token punctuation">{</span>
    <span class="token doc-comment comment">/**
     * \u5B89\u88C5\u6309\u94AE\u6587\u5B57
     */</span>
    install<span class="token operator">:</span> <span class="token builtin">string</span><span class="token punctuation">;</span>
  
    <span class="token doc-comment comment">/**
     * iOS \u5B89\u88C5\u6587\u5B57
     */</span>
    iOSInstall<span class="token operator">:</span> <span class="token builtin">string</span><span class="token punctuation">;</span>
  
    <span class="token doc-comment comment">/**
     * \u53D6\u6D88\u6309\u94AE\u6587\u5B57
     */</span>
    cancel<span class="token operator">:</span> <span class="token builtin">string</span><span class="token punctuation">;</span>
  
    <span class="token doc-comment comment">/**
     * \u5173\u95ED\u6309\u94AE\u6587\u5B57
     */</span>
    close<span class="token operator">:</span> <span class="token builtin">string</span><span class="token punctuation">;</span>
  
    <span class="token doc-comment comment">/**
     * \u4E0A\u4E00\u5F20\u56FE\u7247\u6587\u5B57
     */</span>
    prevImage<span class="token operator">:</span> <span class="token builtin">string</span><span class="token punctuation">;</span>
  
    <span class="token doc-comment comment">/**
     * \u4E0B\u4E00\u5F20\u56FE\u7247\u6587\u5B57
     */</span>
    nextImage<span class="token operator">:</span> <span class="token builtin">string</span><span class="token punctuation">;</span>
  
    <span class="token doc-comment comment">/**
     * \u5B89\u88C5\u89E3\u91CA
     */</span>
    explain<span class="token operator">:</span> <span class="token builtin">string</span><span class="token punctuation">;</span>
  
    <span class="token doc-comment comment">/**
     * \u63CF\u8FF0\u6807\u7B7E\u6587\u5B57
     */</span>
    desc<span class="token operator">:</span> <span class="token builtin">string</span><span class="token punctuation">;</span>
  
    <span class="token doc-comment comment">/**
     * \u7279\u6027\u6807\u7B7E\u6587\u5B57
     */</span>
    feature<span class="token operator">:</span> <span class="token builtin">string</span><span class="token punctuation">;</span>
  
    <span class="token doc-comment comment">/**
     * \u66F4\u65B0\u5185\u5BB9\u6807\u7B7E\u6587\u5B57
     */</span>
    update<span class="token operator">:</span> <span class="token builtin">string</span><span class="token punctuation">;</span>
  <span class="token punctuation">}</span>
  
  <span class="token keyword">interface</span> <span class="token class-name">PWALocaleConfig</span> <span class="token punctuation">{</span>
    <span class="token punctuation">[</span>localePath<span class="token operator">:</span> <span class="token builtin">string</span><span class="token punctuation">]</span><span class="token operator">:</span> PWALocaleData<span class="token punctuation">;</span>
  <span class="token punctuation">}</span>
  </code></pre><div class="line-numbers" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br><span class="line-number">44</span><br><span class="line-number">45</span><br><span class="line-number">46</span><br><span class="line-number">47</span><br><span class="line-number">48</span><br><span class="line-number">49</span><br><span class="line-number">50</span><br><span class="line-number">51</span><br><span class="line-number">52</span><br><span class="line-number">53</span><br><span class="line-number">54</span><br><span class="line-number">55</span><br></div></div></li><li><p>\u5FC5\u586B: \u5426</p></li></ul><p>PWA \u63D2\u4EF6\u7684\u56FD\u9645\u5316\u914D\u7F6E\u3002</p>`,3);function H(O,D){const c=l("Badge"),s=l("ExternalLinkIcon");return t(),p(r,null,[u,h,b,n("div",m,[f,n("p",null,[k,_,g,a(c,{text:"\u4E0D\u63A8\u8350",type:"warning"})])]),n("div",x,[v,n("p",null,[w,n("a",q,[C,a(s)]),S])]),W,n("div",P,[A,n("p",null,[L,n("a",z,[B,a(s)])])]),y,n("p",null,[I,T,M,n("a",N,[V,a(s)])]),E],64)}var K=i(d,[["render",H]]);export{K as default};
  