{"id":112220,"date":"2026-10-02T21:48:49","date_gmt":"2026-10-02T13:48:49","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/112220.html"},"modified":"2026-10-02T21:48:49","modified_gmt":"2026-10-02T13:48:49","slug":"%e4%bb%8e%e9%9b%b6%e5%bc%80%e5%a7%8b%e7%9a%84%e6%95%85%e4%ba%8b%ef%bc%9a%e4%b8%80%e4%b8%aa%e7%95%aa%e8%8c%84%e9%92%9f%e6%98%af%e5%a6%82%e4%bd%95%e8%af%9e%e7%94%9f%e7%9a%84","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/112220.html","title":{"rendered":"\u4ece\u96f6\u5f00\u59cb\u7684\u6545\u4e8b\uff1a\u4e00\u4e2a\u756a\u8304\u949f\u662f\u5982\u4f55\u8bde\u751f\u7684"},"content":{"rendered":"<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u8fd9\u662f\u4e00\u4e2a\u5173\u4e8e\u65f6\u95f4\u3001\u4ee3\u7801\u548c Electron \u7684\u6545\u4e8b\u3002\u6211\u4eec\u5c06\u8ddf\u968f\u4e00\u4e2a\u756a\u8304\u949f\u5e94\u7528&#xff08;Tomato Clock&#xff09;\u4ece\u4e00\u884c\u547d\u4ee4\u5230\u684c\u9762\u7a97\u53e3\u7684\u5b8c\u6574\u65c5\u7a0b&#xff0c;\u9010\u5c42\u5256\u6790\u5b83\u7684\u6e90\u7801\u67b6\u6784\u3002<\/p>\n<h3>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u89e3\u8bfb\u6e90\u7801\u94fe\u63a5<\/h3>\n<h3>\u5e8f&#xff1a;\u4e00\u5207\u4ece\u4e00\u4e2a\u547d\u4ee4\u5f00\u59cb<\/h3>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u6df1\u591c&#xff0c;\u4f60\u6572\u4e0b&#xff1a;<\/p>\n<p>npm run electron:dev <\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u5c4f\u5e55\u4eae\u8d77&#xff0c;\u4e00\u4e2a 400\u00d7500 \u7684\u684c\u9762\u7a97\u53e3\u7f13\u7f13\u6d6e\u73b0\u2014\u2014\u6df1\u84dd\u8272\u80cc\u666f&#xff0c;\u767d\u8272\u6570\u5b57 25:00&#xff0c;\u56db\u4e2a\u5f69\u8272\u6309\u94ae\u9759\u9759\u7b49\u5f85\u70b9\u51fb\u3002<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u8fd9\u80cc\u540e\u53d1\u751f\u4e86\u4ec0\u4e48&#xff1f;<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u8ba9\u6211\u4eec\u628a\u65f6\u95f4\u5012\u56de&#xff0c;\u4ece\u5934\u8bb2\u8d77\u3002<\/p>\n<h3>\u7b2c\u4e00&#xff1a;\u9879\u76ee\u7684&#034;\u57fa\u56e0\u56fe\u8c31&#034;&#8211;package.json<\/h3>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u6bcf\u4e00\u4e2a Node.js \u9879\u76ee\u7684\u6545\u4e8b&#xff0c;\u90fd\u4ece package.json \u5f00\u59cb\u3002\u5b83\u5c31\u50cf\u8fd9\u4e2a\u5e94\u7528\u7684&#034;\u51fa\u751f\u8bc1\u660e&#034;\u548c&#034;\u80fd\u529b\u6e05\u5355&#034;\u3002<\/p>\n<p>{<br \/>\n  &#034;name&#034;: &#034;tomato-vite-electron&#034;,<br \/>\n  &#034;version&#034;: &#034;1.0.0&#034;,<br \/>\n  &#034;type&#034;: &#034;module&#034;,<br \/>\n  &#034;main&#034;: &#034;electron\/main.js&#034;<br \/>\n} <\/p>\n<p>\u5173\u952e\u89e3\u8bfb&#xff1a;<\/p>\n<table>\n<tr>\n<p>\u5b57\u6bb5<\/p>\n<p>\u542b\u4e49<\/p>\n<p>\u6545\u4e8b\u4e2d\u7684\u89d2\u8272<\/p>\n<\/tr>\n<tbody>\n<tr>\n<td>\n<p>type: &#034;module&#034;<\/p>\n<\/td>\n<td>\n<p>\u4f7f\u7528 ES Module \u8bed\u6cd5<\/p>\n<\/td>\n<td>\n<p>\u544a\u8bc9 Node.js&#xff1a;&#034;\u6211\u7528 import\/export&#xff0c;\u4e0d\u662f require&#034;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>main: &#034;electron\/main.js&#034;<\/p>\n<\/td>\n<td>\n<p>Electron \u5165\u53e3<\/p>\n<\/td>\n<td>\n<p>\u8fd9\u662f\u6574\u4e2a\u684c\u9762\u5e94\u7528\u7684&#034;\u5927\u8111&#034;\u6240\u5728<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>scripts \u811a\u672c\u2014\u2014\u9879\u76ee\u7684&#034;\u5492\u8bed&#034;&#xff1a;<\/p>\n<p>{<br \/>\n    &#034;dev&#034;: &#034;vite&#034;,<br \/>\n    &#034;build&#034;: &#034;vite build&#034;,<br \/>\n    &#034;preview&#034;: &#034;vite preview&#034;,<br \/>\n    &#034;electron:dev&#034;: &#034;vite &#8211;mode electron&#034;,<br \/>\n    &#034;electron:build&#034;: &#034;vite build &amp;&amp; electron-builder&#034;<br \/>\n  } <\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5f53\u4f60\u8f93\u5165 npm run electron:dev \u65f6&#xff0c;Vite \u542f\u52a8\u5f00\u53d1\u670d\u52a1\u5668&#xff0c;\u540c\u65f6 vite-plugin-electron \u63d2\u4ef6\u4f1a\u542f\u52a8 Electron \u4e3b\u8fdb\u7a0b&#xff0c;\u4e24\u8005\u901a\u8fc7\u73af\u5883\u53d8\u91cf VITE_DEV_SERVER_URL \u5efa\u7acb\u8fde\u63a5\u3002<\/p>\n<p>\u751f\u4ea7\u73af\u5883\u53ea\u9700\u8981 Vue\u2014\u2014\u56e0\u4e3a\u6700\u7ec8\u6253\u5305\u540e&#xff0c;Electron \u52a0\u8f7d\u7684\u662f\u9759\u6001 HTML \u6587\u4ef6&#xff0c;\u4e0d\u9700\u8981 Vite \u6216 Electron \u672c\u8eab\u3002<\/p>\n<\/p>\n<h3>\u7b2c\u4e8c&#xff1a;Vite \u7684\u9b54\u6cd5&#8211;vite.config.js<\/h3>\n<p>\u00a0 \u00a0 \u00a0Vite \u662f\u8fd9\u4e2a\u9879\u76ee\u7684&#034;\u9b54\u6cd5\u5de5\u574a&#034;\u3002\u914d\u7f6e\u6587\u4ef6\u51b3\u5b9a\u4e86\u4ee3\u7801\u5982\u4f55\u88ab\u7f16\u8bd1\u3001\u5982\u4f55\u88ab Electron \u52a0\u8f7d\u3002\u00a0 \u00a0 <\/p>\n<p>import { defineConfig } from &#039;vite&#039;<br \/>\nimport vue from &#039;&#064;vitejs\/plugin-vue&#039;<br \/>\nimport electron from &#039;vite-plugin-electron&#039;<br \/>\nimport renderer from &#039;vite-plugin-electron-renderer&#039;<br \/>\nimport { fileURLToPath } from &#039;url&#039;<\/p>\n<p>export default defineConfig({<br \/>\n  plugins: [<br \/>\n    vue(),                 \/\/ \u2460 \u8ba9 Vite \u7406\u89e3 .vue \u5355\u6587\u4ef6\u7ec4\u4ef6<br \/>\n    electron([             \/\/ \u2461 Electron \u4e3b\u8fdb\u7a0b\u63d2\u4ef6<br \/>\n      {<br \/>\n        entry: &#039;electron\/main.js&#039;,<br \/>\n        onstart(options) {<br \/>\n          options.startup()          \/\/ \u4e3b\u8fdb\u7a0b\u53d8\u5316\u65f6\u81ea\u52a8\u91cd\u542f Electron<br \/>\n        },<br \/>\n        vite: {<br \/>\n          build: {<br \/>\n            sourcemap: true,<br \/>\n            outDir: &#039;dist\/electron&#039;,<br \/>\n          },<br \/>\n        },<br \/>\n      },<br \/>\n    ]),<br \/>\n    renderer(),           \/\/ \u2462 \u8ba9\u6e32\u67d3\u8fdb\u7a0b\u4e5f\u80fd\u7528 Node.js API&#xff08;\u867d\u7136\u672c\u9879\u76ee\u672a\u4f7f\u7528&#xff09;<br \/>\n  ],<br \/>\n  resolve: {<br \/>\n    alias: {<br \/>\n      &#039;&#064;&#039;: fileURLToPath(new URL(&#039;.\/src&#039;, import.meta.url))<br \/>\n    }<br \/>\n  }<br \/>\n})<\/p>\n<p>\u4e09\u628a\u94a5\u5319\u7684\u89e3\u8bfb&#xff1a;<\/p>\n<p>vue()          \u2192 \u7f16\u8bd1 .vue \u6587\u4ef6&#xff0c;\u652f\u6301 SFC \u70ed\u66f4\u65b0<br \/>\nelectron()     \u2192 \u76d1\u542c\u4e3b\u8fdb\u7a0b\u4ee3\u7801&#xff0c;\u53d8\u5316\u65f6\u91cd\u542f Electron<br \/>\nrenderer()     \u2192 \u4e3a\u6e32\u67d3\u8fdb\u7a0b\u6ce8\u5165 Node.js \u80fd\u529b          <\/p>\n<p>\u8def\u5f84\u522b\u540d &#064;\u200b \u8ba9\u4f60\u53ef\u4ee5\u5199 import Timer from &#039;&#064;\/components\/Timer.vue&#039; \u800c\u4e0d\u662f ..\/..\/..\/components\/Timer.vue\u2014\u2014\u5728\u5927\u578b\u9879\u76ee\u4e2d\u8fd9\u662f\u6551\u547d\u7684\u8bbe\u8ba1\u3002<\/p>\n<h3>\u7b2c\u4e09&#xff1a;\u6837\u5f0f\u7684\u70bc\u91d1\u672f&#8211;Tailwind \u4e09\u5251\u5ba2<\/h3>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0tailwind.config.js<\/p>\n<p>\/** &#064;type {import(&#039;tailwindcss&#039;).Config} *\/<br \/>\nexport default {<br \/>\n  content: [<br \/>\n    &#034;.\/index.html&#034;,<br \/>\n    &#034;.\/src\/**\/*.{vue,js,ts,jsx,tsx}&#034;,<br \/>\n  ],<br \/>\n  theme: {<br \/>\n    extend: {},<br \/>\n  },<br \/>\n  plugins: [],<br \/>\n}<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0content \u6570\u7ec4\u544a\u8bc9 Tailwind&#xff1a;\u53bb\u8fd9\u4e9b\u6587\u4ef6\u91cc\u626b\u63cf\u7c7b\u540d&#xff0c;\u6ca1\u7528\u5230\u7684\u5c31\u5220\u6389\u3002\u8fd9\u5c31\u662f Tailwind \u80fd\u505a\u5230&#034;\u751f\u4ea7\u73af\u5883 CSS \u53ea\u6709\u51e0KB&#034;\u7684\u79d8\u5bc6\u2014\u2014Tree Shaking\u3002<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0postcss.config.js<\/p>\n<p>export default {<br \/>\n  plugins: {<br \/>\n    tailwindcss: {},<br \/>\n    autoprefixer: {},<br \/>\n  },<br \/>\n} <\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0PostCSS \u662f&#034;CSS \u7684 Babel&#034;\u3002\u5b83\u8ba9 Tailwind \u7684\u6307\u4ee4&#xff08;&#064;tailwind base;&#xff09;\u88ab\u7f16\u8bd1\u6210\u771f\u5b9e CSS&#xff0c;\u540c\u65f6 autoprefixer \u81ea\u52a8\u6dfb\u52a0 -webkit-\u3001-moz- \u7b49\u6d4f\u89c8\u5668\u524d\u7f00\u3002<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0src\/style.css<\/p>\n<p>&#064;tailwind base;<br \/>\n&#064;tailwind components;<br \/>\n&#064;tailwind utilities;<\/p>\n<p>body {<br \/>\n  margin: 0;<br \/>\n}<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u4e09\u884c\u6307\u4ee4&#xff0c;\u5f15\u5165 Tailwind \u7684\u5168\u90e8\u529b\u91cf&#xff1a;<\/p>\n<ul>\n<li>base&#xff1a;\u6d4f\u89c8\u5668\u91cd\u7f6e\u6837\u5f0f&#xff08;\u7c7b\u4f3c normalize.css&#xff09;<\/li>\n<li>components&#xff1a;\u53ef\u590d\u7528\u7ec4\u4ef6\u6837\u5f0f&#xff08;\u672c\u9879\u76ee\u672a\u81ea\u5b9a\u4e49&#xff09;<\/li>\n<li>utilities&#xff1a;\u6240\u6709\u539f\u5b50\u7c7b&#xff08;flex\u3001text-7xl\u3001bg-[#1a1a2e] \u7b49&#xff09;<\/li>\n<\/ul>\n<h3>\u7b2c\u56db&#xff1a;Vue \u7684\u5165\u53e3&#8211;src\/main.js<\/h3>\n<p>import { createApp } from &#039;vue&#039;<br \/>\nimport &#039;.\/style.css&#039;<br \/>\nimport App from &#039;.\/App.vue&#039;<\/p>\n<p>createApp(App).mount(&#039;#app&#039;) <\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u56db\u884c\u4ee3\u7801&#xff0c;\u5b8c\u6210\u4e09\u4ef6\u4e8b&#xff1a;<\/p>\n<p>1. \u521b\u5efa Vue \u5e94\u7528\u5b9e\u4f8b<br \/>\n2. \u5bfc\u5165\u5168\u5c40\u6837\u5f0f&#xff08;Tailwind \u5728\u6b64\u751f\u6548&#xff09;<br \/>\n3. \u5c06 App \u7ec4\u4ef6\u6302\u8f7d\u5230 index.html \u4e2d id&#061;&#034;app&#034; \u7684 DOM \u8282\u70b9 <\/p>\n<h3>\u7b2c\u4e94&#xff1a;HTML \u7684\u9aa8\u67b6&#8211;index.html<\/h3>\n<p>&lt;!DOCTYPE html&gt;<br \/>\n&lt;html lang&#061;&#034;zh-CN&#034;&gt;<br \/>\n&lt;head&gt;<br \/>\n  &lt;meta charset&#061;&#034;UTF-8&#034;&gt;<br \/>\n  &lt;meta name&#061;&#034;viewport&#034; content&#061;&#034;width&#061;device-width, initial-scale&#061;1.0&#034;&gt;<br \/>\n  &lt;title&gt;\u756a\u8304\u949f&lt;\/title&gt;<br \/>\n&lt;\/head&gt;<br \/>\n&lt;body&gt;<br \/>\n  &lt;div id&#061;&#034;app&#034;&gt;&lt;\/div&gt;<br \/>\n  &lt;script type&#061;&#034;module&#034; src&#061;&#034;\/src\/main.js&#034;&gt;&lt;\/script&gt;<br \/>\n&lt;\/body&gt;<br \/>\n&lt;\/html&gt; <\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u8fd9\u662f\u6574\u4e2a\u5e94\u7528\u7684&#034;\u7a7a\u753b\u5e03&#034;\u3002&lt;div id&#061;&#034;app&#034;&gt; \u662f Vue \u7684\u6302\u8f7d\u70b9&#xff0c;&lt;script type&#061;&#034;module&#034;&gt; \u8ba9\u6d4f\u89c8\u5668\u4ee5 ES Module \u65b9\u5f0f\u52a0\u8f7d\u5165\u53e3\u3002<\/p>\n<p>Electron \u89c6\u89d2&#xff1a;Electron \u7684 BrowserWindow \u6700\u7ec8 loadURL \u6216 loadFile \u52a0\u8f7d\u7684\u5c31\u662f\u8fd9\u4e2a HTML\u3002<\/p>\n<h3>\u7b2c\u516d&#xff1a;\u8ba1\u65f6\u5668\u7684\u5fc3\u810f&#8211;Timer.vue<\/h3>\n<p>\u00a0 \u00a0\u8fd9\u662f\u6574\u4e2a\u9879\u76ee\u6700\u6838\u5fc3\u7684\u7ec4\u4ef6\u3002\u5b83\u4e0d\u5173\u5fc3 UI \u957f\u4ec0\u4e48\u6837&#xff0c;\u53ea\u5173\u5fc3\u65f6\u95f4\u600e\u4e48\u8d70\u3002<\/p>\n<p>\u6a21\u677f\u5c42<\/p>\n<p>&lt;template&gt;<br \/>\n  &lt;div class&#061;&#034;text-7xl my-8&#034;&gt;<br \/>\n    {{ timeStr }}<br \/>\n  &lt;\/div&gt;<br \/>\n&lt;\/template&gt; <\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u53ea\u505a\u4e00\u4ef6\u4e8b&#xff1a;\u663e\u793a\u683c\u5f0f\u5316\u540e\u7684\u65f6\u95f4\u5b57\u7b26\u4e32\u3002<\/p>\n<p>\u903b\u8f91\u5c42&#8211;\u72b6\u6001\u673a<\/p>\n<p>const props &#061; defineProps([&#039;initSeconds&#039;])  \/\/ \u4ece\u7236\u7ec4\u4ef6\u63a5\u6536\u521d\u59cb\u79d2\u6570<br \/>\nconst emit &#061; defineEmits([&#039;finish&#039;])        \/\/ \u5411\u7236\u7ec4\u4ef6\u53d1\u5c04&#034;\u5b8c\u6210&#034;\u4e8b\u4ef6<\/p>\n<p>const totalSeconds &#061; ref(props.initSeconds) \/\/ \u5f53\u524d\u5269\u4f59\u79d2\u6570<br \/>\nlet timerId &#061; null                          \/\/ setInterval \u7684\u53e5\u67c4<br \/>\nconst isRunning &#061; ref(false)                \/\/ \u8fd0\u884c\u72b6\u6001\u9501 <\/p>\n<p>\u6838\u5fc3\u7b97\u6cd5&#xff1a;<\/p>\n<p>const timeStr &#061; computed(() &#061;&gt; {<br \/>\n  const s &#061; totalSeconds.value<br \/>\n  const m &#061; Math.floor(s \/ 60)<br \/>\n  const sec &#061; s % 60<br \/>\n  return String(m).padStart(2, &#039;0&#039;) &#043; &#039;:&#039; &#043; String(sec).padStart(2, &#039;0&#039;)<br \/>\n}) <\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u8fd9\u662f\u4e00\u4e2a\u8ba1\u7b97\u5c5e\u6027&#xff0c;\u4f9d\u8d56 totalSeconds\u3002\u6bcf\u5f53 totalSeconds \u53d8\u5316&#xff0c;timeStr \u81ea\u52a8\u91cd\u65b0\u8ba1\u7b97\u3002\u8f93\u51fa\u683c\u5f0f&#xff1a;MM:SS\u3002<\/p>\n<p>\u5fc3\u8df3\u51fd\u6570&#xff1a;<\/p>\n<p>function tick() {<br \/>\n  totalSeconds.value&#8211;<br \/>\n  if (totalSeconds.value &lt;&#061; 0) {<br \/>\n    clearInterval(timerId)<br \/>\n    isRunning.value &#061; false<br \/>\n    emit(&#039;finish&#039;)    \/\/ \u65f6\u95f4\u5230&#xff01;\u901a\u77e5\u7236\u7ec4\u4ef6<br \/>\n  }<br \/>\n} <\/p>\n<p>\u5bf9\u5916 API&#xff08;defineExpose&#xff09;&#xff1a;<\/p>\n<p>defineExpose({<br \/>\n  start,   \/\/ \u5f00\u59cb\u8ba1\u65f6<br \/>\n  pause,   \/\/ \u6682\u505c\u8ba1\u65f6<br \/>\n  reset    \/\/ \u91cd\u7f6e\u8ba1\u65f6<br \/>\n}) <\/p>\n<p>\u8bbe\u8ba1\u4eae\u70b9&#xff1a;defineExpose \u8ba9\u7236\u7ec4\u4ef6\u53ef\u4ee5\u901a\u8fc7 ref \u76f4\u63a5\u8c03\u7528\u8fd9\u4e9b\u65b9\u6cd5\u3002\u8fd9\u662f\u4e00\u79cd\u547d\u4ee4\u5f0f API \u8bbe\u8ba1\u2014\u2014\u7236\u7ec4\u4ef6\u8bf4&#034;\u5f00\u59cb&#034;&#xff0c;Timer \u5c31&#034;\u5f00\u59cb&#034;&#xff0c;\u800c\u4e0d\u662f\u901a\u8fc7 props \u9a71\u52a8\u3002<\/p>\n<p>\u9632\u91cd\u590d\u542f\u52a8&#xff1a;<\/p>\n<p>const start &#061; () &#061;&gt; {<br \/>\n  if (isRunning.value) return  \/\/ \u5df2\u7ecf\u5728\u8dd1\u4e86&#xff1f;\u5ffd\u7565<br \/>\n  isRunning.value &#061; true<br \/>\n  timerId &#061; setInterval(tick, 1000)<br \/>\n} <\/p>\n<p>\u54cd\u5e94\u5f0f\u91cd\u7f6e&#xff08;watch&#xff09;&#xff1a;<\/p>\n<p>watch(() &#061;&gt; props.initSeconds, (val) &#061;&gt; {<br \/>\n  clearInterval(timerId)<br \/>\n  isRunning.value &#061; false<br \/>\n  totalSeconds.value &#061; val<br \/>\n}) <\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5f53\u7236\u7ec4\u4ef6\u5207\u6362&#034;\u5de5\u4f5c\/\u4f11\u606f&#034;\u6a21\u5f0f\u65f6&#xff0c;initSeconds \u53d8\u5316&#xff0c;Timer \u81ea\u52a8\u505c\u6b62\u5e76\u91cd\u7f6e\u2014\u2014\u4e0d\u9700\u8981\u7236\u7ec4\u4ef6\u624b\u52a8\u8c03\u7528 reset()\u3002<\/p>\n<h3>\u7b2c\u4e03&#xff1a;\u6307\u6325\u5bb6&#8211;App.vue<\/h3>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0App.vue \u662f\u6574\u4e2a\u5e94\u7528\u7684\u6307\u6325\u5b98&#xff0c;\u5b83\u7f16\u6392 Timer \u7ec4\u4ef6&#xff0c;\u7ba1\u7406\u5e94\u7528\u72b6\u6001\u3002<\/p>\n<p>\u6a21\u677f\u7ed3\u6784<\/p>\n<p>&lt;template&gt;<br \/>\n  &lt;div class&#061;&#034;bg-[#1a1a2e] text-white h-screen flex items-center justify-center font-sans&#034;&gt;<br \/>\n    &lt;div class&#061;&#034;text-center&#034;&gt;<br \/>\n      &lt;h1 class&#061;&#034;text-2xl mb-5&#034;&gt;{{ modeText }}&lt;\/h1&gt;<br \/>\n      &lt;Timer :init-seconds&#061;&#034;currentSeconds&#034; &#064;finish&#061;&#034;onTimerFinish&#034; ref&#061;&#034;timerRef&#034; \/&gt;<br \/>\n      &lt;div class&#061;&#034;grid grid-cols-2 gap-3 mt-8&#034;&gt;<br \/>\n        &lt;button &#064;click&#061;&#034;startTimer&#034; class&#061;&#034;&#8230; bg-[#2ecc71]&#034;&gt;\u5f00\u59cb&lt;\/button&gt;<br \/>\n        &lt;button &#064;click&#061;&#034;pauseTimer&#034; class&#061;&#034;&#8230; bg-[#f39c12]&#034;&gt;\u6682\u505c&lt;\/button&gt;<br \/>\n        &lt;button &#064;click&#061;&#034;resetTimer&#034; class&#061;&#034;&#8230; bg-[#e74c3c]&#034;&gt;\u91cd\u7f6e&lt;\/button&gt;<br \/>\n        &lt;button &#064;click&#061;&#034;switchMode&#034; class&#061;&#034;&#8230; bg-[#3498db]&#034;&gt;\u5207\u6362\u4f11\u606f&lt;\/button&gt;<br \/>\n      &lt;\/div&gt;<br \/>\n    &lt;\/div&gt;<br \/>\n  &lt;\/div&gt;<br \/>\n&lt;\/template&gt; <\/p>\n<p>\u5e03\u5c40\u89e3\u8bfb&#xff1a;<\/p>\n<p>\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n\u2502         bg-[#1a1a2e]            \u2502  \u2190 \u6df1\u84dd\u80cc\u666f&#xff0c;\u5168\u5c4f<br \/>\n\u2502                                 \u2502<br \/>\n\u2502        \u4e13\u6ce8\u65f6\u95f4 \/ \u4f11\u606f\u65f6\u95f4        \u2502  \u2190 h1 \u6807\u9898<br \/>\n\u2502                                 \u2502<br \/>\n\u2502          25:00                  \u2502  \u2190 Timer \u7ec4\u4ef6<br \/>\n\u2502                                 \u2502<br \/>\n\u2502    \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2510  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2510           \u2502<br \/>\n\u2502    \u2502 \u5f00\u59cb  \u2502  \u2502 \u6682\u505c  \u2502           \u2502  \u2190 2\u00d72 \u6309\u94ae\u7f51\u683c<br \/>\n\u2502    \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2518  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2518           \u2502<br \/>\n\u2502    \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2510  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2510           \u2502<br \/>\n\u2502    \u2502 \u91cd\u7f6e  \u2502  \u2502\u5207\u6362  \u2502           \u2502<br \/>\n\u2502    \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2518  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2518           \u2502<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 <\/p>\n<p>\u72b6\u6001\u7ba1\u7406&#xff1a;<\/p>\n<p>const isWorkMode &#061; ref(true)           \/\/ \u5f53\u524d\u6a21\u5f0f<br \/>\nconst currentSeconds &#061; ref(25 * 60)    \/\/ \u5f53\u524d\u5012\u8ba1\u65f6\u79d2\u6570<br \/>\nconst timerRef &#061; ref(null)             \/\/ Timer \u7ec4\u4ef6\u7684\u5f15\u7528 <\/p>\n<p>\u6a21\u5f0f\u5207\u6362\u903b\u8f91&#xff1a;<\/p>\n<p>function switchMode() {<br \/>\n  isWorkMode.value &#061; !isWorkMode.value<br \/>\n  currentSeconds.value &#061; isWorkMode.value ? 25 * 60 : 5 * 60<br \/>\n} <\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5207\u6362\u6a21\u5f0f\u65f6&#xff1a;<\/p>\n<ul>\n<li>isWorkMode \u7ffb\u8f6c<\/li>\n<li>currentSeconds \u53d8\u4e3a 25 \u5206\u949f\u6216 5 \u5206\u949f<\/li>\n<li>\u7531\u4e8e watch(() &#061;&gt; props.initSeconds) \u7684\u5b58\u5728&#xff0c;Timer \u81ea\u52a8\u91cd\u7f6e<\/li>\n<\/ul>\n<p>\u5b8c\u6210\u56de\u8c03&#xff1a;<\/p>\n<p>function onTimerFinish() {<br \/>\n  alert(&#039;\u65f6\u95f4\u5230&#xff01;&#039;)<br \/>\n} <\/p>\n<p>\u5f53\u524d\u4f7f\u7528 alert() \u5f39\u7a97\u3002\u5728\u751f\u4ea7\u7ea7\u5e94\u7528\u4e2d&#xff0c;\u53ef\u4ee5\u66ff\u6362\u4e3a\u7cfb\u7edf\u901a\u77e5&#xff08;Notification API&#xff09;\u6216 Electron \u7684 Tray \u63d0\u9192\u3002<\/p>\n<h3>\u7b2c\u516b&#xff1a;\u684c\u9762\u58f3&#8211;electron\/main.js<\/h3>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Electron \u7684\u4e3b\u8fdb\u7a0b\u662f\u8fd9\u4e2a\u5e94\u7528\u7684&#034;\u64cd\u4f5c\u7cfb\u7edf\u63a5\u53e3&#034;\u3002\u5b83\u521b\u5efa\u7a97\u53e3\u3001\u7ba1\u7406\u5e94\u7528\u751f\u547d\u5468\u671f\u3002<\/p>\n<p>import { app, BrowserWindow } from &#039;electron&#039;<br \/>\nimport path from &#039;path&#039;<br \/>\nimport { fileURLToPath } from &#039;url&#039;<\/p>\n<p>const __filename &#061; fileURLToPath(import.meta.url)<br \/>\nconst __dirname &#061; path.dirname(__filename) <\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ESM \u517c\u5bb9\u5904\u7406&#xff1a;Electron \u4e3b\u8fdb\u7a0b\u4f7f\u7528 ESM&#xff08;type: &#034;module&#034;&#xff09;&#xff0c;\u6240\u4ee5\u4e0d\u80fd\u7528 __dirname \u548c __filename\u3002\u901a\u8fc7 fileURLToPath \u624b\u52a8\u8ba1\u7b97\u3002<\/p>\n<p>\u7a97\u53e3\u521b\u5efa<\/p>\n<p>function createWindow() {<br \/>\n  const win &#061; new BrowserWindow({<br \/>\n    width: 400,<br \/>\n    height: 500,<br \/>\n    resizable: false,          \/\/ \u56fa\u5b9a\u5927\u5c0f&#xff0c;\u4e0d\u53ef\u62d6\u62fd\u7f29\u653e<br \/>\n    webPreferences: {<br \/>\n      nodeIntegration: false,  \/\/ \u5b89\u5168&#xff1a;\u6e32\u67d3\u8fdb\u7a0b\u4e0d\u80fd\u76f4\u63a5\u7528 Node.js<br \/>\n      contextIsolation: true   \/\/ \u5b89\u5168&#xff1a;\u4e0a\u4e0b\u6587\u9694\u79bb<br \/>\n    }<br \/>\n  }) <\/p>\n<p>\u5b89\u5168\u914d\u7f6e\u89e3\u8bfb&#xff1a;<\/p>\n<table>\n<tr>\n<p>\u914d\u7f6e\u9879<\/p>\n<p>\u503c<\/p>\n<p>\u4e3a\u4ec0\u4e48<\/p>\n<\/tr>\n<tbody>\n<tr>\n<td>\n<p>nodeIntegration<\/p>\n<\/td>\n<td>\n<p>false<\/p>\n<\/td>\n<td>\n<p>\u9632\u6b62\u6e32\u67d3\u8fdb\u7a0b\u6267\u884c require(&#039;child_process&#039;) \u7b49\u5371\u9669\u64cd\u4f5c<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>contextIsolation<\/p>\n<\/td>\n<td>\n<p>true<\/p>\n<\/td>\n<td>\n<p>\u9632\u6b62\u7f51\u9875\u811a\u672c\u8bbf\u95ee Electron \u5185\u90e8 API<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>resizable<\/p>\n<\/td>\n<td>\n<p>false<\/p>\n<\/td>\n<td>\n<p>\u756a\u8304\u949f\u662f\u6781\u7b80\u5de5\u5177&#xff0c;\u56fa\u5b9a\u5c3a\u5bf8\u66f4\u4e13\u6ce8<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u52a0\u8f7d\u7b56\u7565<\/p>\n<p>if (process.env.VITE_DEV_SERVER_URL) {<br \/>\n    win.loadURL(process.env.VITE_DEV_SERVER_URL)  \/\/ \u5f00\u53d1\u6a21\u5f0f&#xff1a;\u52a0\u8f7d Vite \u670d\u52a1\u5668<br \/>\n  } else {<br \/>\n    win.loadFile(path.join(__dirname, &#039;..\/dist\/index.html&#039;))  \/\/ \u751f\u4ea7\u6a21\u5f0f&#xff1a;\u52a0\u8f7d\u6253\u5305\u540e\u7684 HTML<br \/>\n  } <\/p>\n<p>\u4e24\u79cd\u6a21\u5f0f\u7684\u5207\u6362&#xff1a;<\/p>\n<p>\u5f00\u53d1\u6a21\u5f0f&#xff1a;Electron \u2192 http:\/\/localhost:5173 \u2192 Vite HMR \u70ed\u66f4\u65b0<br \/>\n\u751f\u4ea7\u6a21\u5f0f&#xff1a;Electron \u2192 dist\/index.html \u2192 \u9759\u6001\u6587\u4ef6 <\/p>\n<p>\u5e94\u7528\u751f\u547d\u5468\u671f<\/p>\n<p>app.whenReady().then(createWindow)<\/p>\n<p>app.on(&#039;window-all-closed&#039;, () &#061;&gt; {<br \/>\n  if (process.platform !&#061;&#061; &#039;darwin&#039;) app.quit()<br \/>\n}) <\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0macOS \u4e0a\u5173\u95ed\u6240\u6709\u7a97\u53e3\u540e\u5e94\u7528\u4ecd\u7136\u9a7b\u7559&#xff08;macOS \u60ef\u4f8b&#xff09;&#xff0c;\u5176\u4ed6\u5e73\u53f0\u76f4\u63a5\u9000\u51fa\u3002<\/p>\n<\/p>\n<h3>\u5c3e\u58f0&#xff1a;\u4e00\u4e2a\u756a\u8304\u949f\u7684\u542f\u793a<\/h3>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u8fd9\u4e2a\u9879\u76ee\u867d\u7136\u53ea\u6709 ~300 \u884c\u6838\u5fc3\u4ee3\u7801&#xff0c;\u4f46\u5b83\u5c55\u793a\u4e86\u4e00\u4e2a\u73b0\u4ee3\u684c\u9762\u5e94\u7528\u5f00\u53d1\u7684\u5b8c\u6574\u8303\u5f0f&#xff1a;<\/p>\n<p>Vue 3       \u2192 \u58f0\u660e\u5f0f UI &#043; \u54cd\u5e94\u5f0f\u72b6\u6001<br \/>\nVite        \u2192 \u6781\u901f\u6784\u5efa &#043; HMR<br \/>\nElectron    \u2192 Web \u6280\u672f \u2192 \u684c\u9762\u5e94\u7528<br \/>\nTailwind    \u2192 \u539f\u5b50\u5316\u6837\u5f0f&#xff0c;\u96f6\u5fc3\u667a\u8d1f\u62c5 <\/p>\n<p>\u756a\u8304\u949f\u7684\u7cbe\u9ad3\u4e0d\u5728\u4e8e\u4ee3\u7801&#xff0c;\u800c\u5728\u4e8e\u4e13\u6ce8\u3002\u613f\u8fd9\u4e2a\u5e94\u7528\u80fd\u5e2e\u4f60\u628a\u65f6\u95f4\u5207\u6210\u4e00\u5757\u5757\u756a\u8304&#xff0c;\u6bcf\u4e00\u5757\u90fd\u9971\u6ee1\u800c\u5145\u5b9e\u3002<\/p>\n<\/p>\n<h3>\u9644\u5f55&#xff1a;\u547d\u4ee4\u80cc\u540e\u7684\u6545\u4e8b<\/h3>\n<table>\n<tr>\n<p>\u547d\u4ee4<\/p>\n<p>\u53d1\u751f\u4e86\u4ec0\u4e48<\/p>\n<\/tr>\n<tbody>\n<tr>\n<td>\n<p>npm install<\/p>\n<\/td>\n<td>\n<p>\u5b89\u88c5\u6240\u6709\u4f9d\u8d56\u5230 node_modules&#xff0c;\u751f\u6210 package-lock.json<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>npm run dev<\/p>\n<\/td>\n<td>\n<p>\u542f\u52a8 Vite \u5f00\u53d1\u670d\u52a1\u5668&#xff0c;\u6d4f\u89c8\u5668\u53ef\u8bbf\u95ee localhost:5173<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>npm run electron:dev<\/p>\n<\/td>\n<td>\n<p>Vite &#043; Electron \u540c\u65f6\u542f\u52a8&#xff0c;\u684c\u9762\u7a97\u53e3\u51fa\u73b0&#xff0c;\u652f\u6301\u70ed\u66f4\u65b0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>npm run electron:build<\/p>\n<\/td>\n<td>\n<p>Vite \u6253\u5305 Vue \u2192 dist\/&#xff0c;Electron Builder \u6253\u5305\u4e3a exe \u2192 dist_electron\/<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>\u8fd9\u662f\u4e00\u4e2a\u5173\u4e8e\u65f6\u95f4\u3001\u4ee3\u7801\u548c Electron \u7684\u6545\u4e8b\u3002\u6211\u4eec\u5c06\u8ddf\u968f\u4e00\u4e2a\u756a\u8304\u949f\u5e94\u7528&#xff08;Tomato Clock&#xff09;\u4ece\u4e00\u884c\u547d\u4ee4\u5230\u684c\u9762\u7a97\u53e3\u7684\u5b8c\u6574\u65c5\u7a0b&#xff0c;\u9010\u5c42\u5256\u6790\u5b83\u7684\u6e90\u7801\u67b6\u6784\u3002 \u89e3\u8bfb\u6e90\u7801\u94fe\u63a5<br \/>\n\u5e8f&#xff1a;\u4e00\u5207\u4ece\u4e00\u4e2a\u547d\u4ee4\u5f00\u59cb \u6df1\u591c&#xff0c;\u4f60\u6572\u4e0b&#xff1a;<br \/>\nnpm run electron:dev \u5c4f\u5e55\u4eae\u8d77&#xff0c;\u4e00\u4e2a 400\u00d7500 \u7684\u684c\u9762\u7a97\u53e3\u7f13\u7f13\u6d6e\u73b0\u2014\u2014\u6df1\u84dd\u8272\u80cc\u666f&#xff0c;\u767d\u8272\u6570\u5b57 25:00&#xff0c;\u56db\u4e2a\u5f69<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[11820,12567,12764,625],"topic":[],"class_list":["post-112220","post","type-post","status-publish","format-standard","hentry","category-server","tag-atomgit","tag-12567","tag-12764","tag-vue-js"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u4ece\u96f6\u5f00\u59cb\u7684\u6545\u4e8b\uff1a\u4e00\u4e2a\u756a\u8304\u949f\u662f\u5982\u4f55\u8bde\u751f\u7684 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/112220.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u4ece\u96f6\u5f00\u59cb\u7684\u6545\u4e8b\uff1a\u4e00\u4e2a\u756a\u8304\u949f\u662f\u5982\u4f55\u8bde\u751f\u7684 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u8fd9\u662f\u4e00\u4e2a\u5173\u4e8e\u65f6\u95f4\u3001\u4ee3\u7801\u548c Electron \u7684\u6545\u4e8b\u3002\u6211\u4eec\u5c06\u8ddf\u968f\u4e00\u4e2a\u756a\u8304\u949f\u5e94\u7528&#xff08;Tomato Clock&#xff09;\u4ece\u4e00\u884c\u547d\u4ee4\u5230\u684c\u9762\u7a97\u53e3\u7684\u5b8c\u6574\u65c5\u7a0b&#xff0c;\u9010\u5c42\u5256\u6790\u5b83\u7684\u6e90\u7801\u67b6\u6784\u3002 \u89e3\u8bfb\u6e90\u7801\u94fe\u63a5 \u5e8f&#xff1a;\u4e00\u5207\u4ece\u4e00\u4e2a\u547d\u4ee4\u5f00\u59cb \u6df1\u591c&#xff0c;\u4f60\u6572\u4e0b&#xff1a; npm run electron:dev \u5c4f\u5e55\u4eae\u8d77&#xff0c;\u4e00\u4e2a 400\u00d7500 \u7684\u684c\u9762\u7a97\u53e3\u7f13\u7f13\u6d6e\u73b0\u2014\u2014\u6df1\u84dd\u8272\u80cc\u666f&#xff0c;\u767d\u8272\u6570\u5b57 25:00&#xff0c;\u56db\u4e2a\u5f69\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/112220.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-02T13:48:49+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/112220.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/112220.html\",\"name\":\"\u4ece\u96f6\u5f00\u59cb\u7684\u6545\u4e8b\uff1a\u4e00\u4e2a\u756a\u8304\u949f\u662f\u5982\u4f55\u8bde\u751f\u7684 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-02T13:48:49+00:00\",\"dateModified\":\"2026-10-02T13:48:49+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/112220.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/112220.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/112220.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u4ece\u96f6\u5f00\u59cb\u7684\u6545\u4e8b\uff1a\u4e00\u4e2a\u756a\u8304\u949f\u662f\u5982\u4f55\u8bde\u751f\u7684\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u4ece\u96f6\u5f00\u59cb\u7684\u6545\u4e8b\uff1a\u4e00\u4e2a\u756a\u8304\u949f\u662f\u5982\u4f55\u8bde\u751f\u7684 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/112220.html","og_locale":"zh_CN","og_type":"article","og_title":"\u4ece\u96f6\u5f00\u59cb\u7684\u6545\u4e8b\uff1a\u4e00\u4e2a\u756a\u8304\u949f\u662f\u5982\u4f55\u8bde\u751f\u7684 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u8fd9\u662f\u4e00\u4e2a\u5173\u4e8e\u65f6\u95f4\u3001\u4ee3\u7801\u548c Electron \u7684\u6545\u4e8b\u3002\u6211\u4eec\u5c06\u8ddf\u968f\u4e00\u4e2a\u756a\u8304\u949f\u5e94\u7528&#xff08;Tomato Clock&#xff09;\u4ece\u4e00\u884c\u547d\u4ee4\u5230\u684c\u9762\u7a97\u53e3\u7684\u5b8c\u6574\u65c5\u7a0b&#xff0c;\u9010\u5c42\u5256\u6790\u5b83\u7684\u6e90\u7801\u67b6\u6784\u3002 \u89e3\u8bfb\u6e90\u7801\u94fe\u63a5 \u5e8f&#xff1a;\u4e00\u5207\u4ece\u4e00\u4e2a\u547d\u4ee4\u5f00\u59cb \u6df1\u591c&#xff0c;\u4f60\u6572\u4e0b&#xff1a; npm run electron:dev \u5c4f\u5e55\u4eae\u8d77&#xff0c;\u4e00\u4e2a 400\u00d7500 \u7684\u684c\u9762\u7a97\u53e3\u7f13\u7f13\u6d6e\u73b0\u2014\u2014\u6df1\u84dd\u8272\u80cc\u666f&#xff0c;\u767d\u8272\u6570\u5b57 25:00&#xff0c;\u56db\u4e2a\u5f69","og_url":"https:\/\/www.wsisp.com\/helps\/112220.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-02T13:48:49+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/112220.html","url":"https:\/\/www.wsisp.com\/helps\/112220.html","name":"\u4ece\u96f6\u5f00\u59cb\u7684\u6545\u4e8b\uff1a\u4e00\u4e2a\u756a\u8304\u949f\u662f\u5982\u4f55\u8bde\u751f\u7684 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-02T13:48:49+00:00","dateModified":"2026-10-02T13:48:49+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/112220.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/112220.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/112220.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u4ece\u96f6\u5f00\u59cb\u7684\u6545\u4e8b\uff1a\u4e00\u4e2a\u756a\u8304\u949f\u662f\u5982\u4f55\u8bde\u751f\u7684"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/112220","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=112220"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/112220\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=112220"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=112220"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=112220"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=112220"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}