{
  "version": "https://jsonfeed.org/version/1", 
  "title": "Nuxt.js", 
  "description": "", 
  "home_page_url": "https://www.v2ex.com/go/nuxtjs", 
  "feed_url": "https://www.v2ex.com/feed/nuxtjs.json", 
  "items": [
    {
      "author": {
        "url": "https://www.v2ex.com/member/Strive123456", 
        "name": "Strive123456", 
        "avatar": "https://cdn.v2ex.com/gravatar/640d3b27415ac7e658a19d39ce2ac165?s=73&d=retro"
      }, 
      "url": "https://www.v2ex.com/t/1127486", 
      "date_modified": "2025-04-24T08:33:30+00:00", 
      "content_html": "\u9879\u76ee\u91cc\u6709\u4e00\u4e9b\u9875\u9762\u7528\u5230\u4e86 new Date()\u51fd\u6570\uff0cnuxt3 \u6846\u67b6\u4f1a\u5728\u670d\u52a1\u7aef\u548c\u5ba2\u6237\u7aef\u90fd\u6267\u884c\u4e00\u904d\uff0c\u7531\u4e8e\u5148\u5728\u670d\u52a1\u7aef\u540e\u5728\u5ba2\u6237\u7aef\u6240\u4ee5\u4f1a\u6709\u51e0\u6beb\u79d2\u7684\u5dee\u522b\u5bfc\u81f4\u6e32\u67d3\u4e0d\u4e00\u81f4\u6d4f\u89c8\u5668\u63a7\u5236\u53f0\u62a5\u9519: C6hVy1FW.js:14 Hydration completed but contains mismatches \uff0c\u4f46\u662f\u8fd9\u4e2a\u62a5\u9519\u6211\u5728\u672c\u5730\u5f00\u53d1\u4e0d\u4f1a\u6709\uff0c\u4e0a\u5230\u4e86\u6d4b\u8bd5\u73af\u5883\u5c31\u4f1a\u6709\uff0c\u6709\u6ca1\u6709\u5927\u4f6c\u9047\u5230\u8fc7\u8fd9\u79cd\u62a5\u9519\uff1f", 
      "date_published": "2025-04-23T04:09:25+00:00", 
      "title": "nuxt3 \u5927\u4f6c\u5e2e\u5fd9\u770b\u4e2a\u95ee\u9898\uff01", 
      "id": "https://www.v2ex.com/t/1127486"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/shuyunquan", 
        "name": "shuyunquan", 
        "avatar": "https://cdn.v2ex.com/avatar/6f99/7942/495111_large.png?m=1728713416"
      }, 
      "url": "https://www.v2ex.com/t/1078004", 
      "title": "Nuxt3 \u7684 public \u9759\u6001\u8d44\u6e90\u6587\u4ef6\u600e\u4e48\u66f4\u65b0", 
      "id": "https://www.v2ex.com/t/1078004", 
      "date_published": "2024-10-07T04:05:40+00:00", 
      "content_html": "<p>Nuxt3 \u641e\u4e86\u4e00\u4e2a\u9879\u76ee, \u5728 Public \u6587\u4ef6\u5939\u4e0b\u9762\u653e\u4e86\u4e00\u4e9b\n1.favicon.ico\n2.robots.txt\n3.google \u7684.html</p>\n<p>\u73b0\u5728\u78b0\u5230\u4e00\u4e2a\u95ee\u9898, \u53d1\u5e03\u540e\u7684 nuxt3 \u9879\u76ee, \u5982\u679c\u6211\u66f4\u65b0\u4e00\u4e2a.html \u6587\u4ef6\u6216\u8005\u4fee\u6539\u4e86\u670d\u52a1\u5668\u4e0a\u7684 robots.txt, \u90fd\u4e0d\u4f1a\u751f\u6548, \u5fc5\u987b\u8981\u5728\u5f00\u53d1\u73af\u5883\u65b0\u589e/\u4fee\u6539\u6587\u4ef6,\u518d\u91cd\u65b0 build \u6253\u5305\u66f4\u65b0\u5230\u670d\u52a1\u5668\u624d\u53ef\u4ee5, \u8fd9\u6837\u641e\u597d\u9ebb\u70e6, \u6709\u6ca1\u6709\u771f\u6b63\u610f\u4e49\u4e0a\u7684\u9759\u6001\u6587\u4ef6\u5939, \u7c7b\u4f3c\u4e8e.netcore \u7684 wwwroot \u7684\u8fd9\u79cd</p>\n"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/StevenZhl", 
        "name": "StevenZhl", 
        "avatar": "https://cdn.v2ex.com/gravatar/5815169f33a62a6d29cf7414cd3097b1?s=73&d=retro"
      }, 
      "url": "https://www.v2ex.com/t/1066389", 
      "title": "\u5c0f\u5fc3 Nuxt/Device \u7684\u5751", 
      "id": "https://www.v2ex.com/t/1066389", 
      "date_published": "2024-08-20T04:21:33+00:00", 
      "content_html": "<blockquote>\n<p>\u7701\u6d41: device \u63d0\u4f9b\u4e86\u5982<code>const { isMobile } = useDevice()</code>\u7684\u5f62\u5f0f\u6765\u5224\u65ad\u8bbe\u5907\u7c7b\u578b\u3002\u4f46\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5728<code>nuxt build</code>\u6a21\u5f0f\u4e2d\u4f7f\u7528<code>v-if</code>\u4ee5\u53ca\u52a8\u6001\u7c7b\u540d(\u5982<code>&lt;div :class=\"{mobile: isMobile}\"&gt;</code>)\u7684\u5f62\u5f0f\u5747\u53ef\u751f\u6548\uff0c\u800c\u5728<code>nuxt build</code>\u548c<code>nuxt generate</code>\u6a21\u5f0f\u4e2d\u4ec5<code>v-if</code>\u751f\u6548\uff0c\u540e\u8005\u4f1a\u6709\u95ee\u9898\u3002</p>\n</blockquote>\n<ul>\n<li>\u672c\u4eba\u83dc\u9e1f\u524d\u7aef\u4e00\u679a\uff0c\u5728\u4e00\u4e2a\u975e\u4e92\u8054\u7f51\u4f01\u4e1a\u505a\u524d\u7aef\u5f00\u53d1\uff0c\u56e2\u961f\u539f\u672c\u7528\u7684\u662f Angular \uff0c\u6700\u8fd1\u51e0\u4e2a\u9879\u76ee\u56e0\u4e3a\u7532\u65b9\u8981\u6c42\uff0c\u6362\u5230\u4e86 Vue3+Nuxt3 \uff0cSSR \u6a21\u5f0f\uff0c\u6240\u4ee5\u5927\u5bb6\u5bf9 Nuxt \u90fd\u4e86\u89e3\u4e0d\u6df1</li>\n<li>\u524d\u4e24\u5929\u6211\u4eec\u5728\u684c\u9762\u7aef\u505a\u5b8c\u7684\u60c5\u51b5\u4e0b\u505a\u54cd\u5e94\u5f0f\uff0c\u4f46\u662f\u684c\u9762\u7aef\u548c\u624b\u673a\u7aef\u7684 DOM \u5dee\u522b\u6bd4\u8f83\u5927\uff0c\u800c\u4e14\u9875\u9762\u5185\u5bb9\u6bd4\u8f83\u590d\u6742\uff0c\u5982\u679c\u8fd8\u662f\u6309\u7167\u5a92\u4f53\u67e5\u8be2 CSS \u7684\u65b9\u5f0f\u4f1a\u8ba9 CSS \u548c HTML \u5f88\u957f\uff0c\u4e0d\u592a\u597d\u7ef4\u62a4\uff0c\u5e76\u4e14\u4e5f\u5f71\u54cd\u52a0\u8f7d\u901f\u5ea6\uff08\u6bd5\u7adf\u76f8\u5f53\u4e8e\u52a0\u8f7d\u4e24\u4e2a\u7248\u672c\u7684\u9875\u9762\uff09\u3002</li>\n<li>\u6211\u89c9\u5f97\u6bd4\u8f83\u597d\u7684\u5904\u7406\u65b9\u6cd5\u662f\uff1a\u5bf9\u4e8e DOM \u5dee\u522b\u5f88\u5927\u7684\uff0c\u5e72\u8106\u5199\u4e24\u79cd\u7ec4\u4ef6\uff0c\u4f7f\u7528 v-if \u9009\u62e9\u52a0\u8f7d\uff1b\u800c\u5bf9\u4e8e\u5dee\u522b\u4e0d\u5927\u7684\uff0c\u5c31\u52a0\u4e00\u4e2a.mobile \u7684 class \uff0c\u7136\u540e\u5728\u539f\u672c\u7684 CSS \u57fa\u7840\u4e0a\u5fae\u8c03\u4e00\u4e0b\u3002</li>\n<li>\u627e\u4e86\u627e\u76f8\u5173\u7684\u5e16\u5b50\u8fd8\u771f\u53d1\u73b0\u4e86\u4e2a\u63d2\u4ef6\uff0c\u5c31\u662f\u6807\u9898\u63d0\u5230\u7684\u8fd9\u4e2a<a href=\"https://nuxt.com/modules/device\" rel=\"nofollow\">@nuxtjs/device</a>\uff0c\u770b\u7b80\u4ecb\u662f\u901a\u8fc7\u68c0\u6d4b UA \u5224\u65ad\u8bbe\u5907\u7c7b\u578b\u7684\uff0c\u90a3\u7406\u8bba\u4e0a\u5728 DOM \u6302\u8f7d\u4e4b\u524d\u5c31\u80fd\u786e\u5b9a\u7c7b\u578b\uff0c\u8bd5\u4e86\u4e00\u4e0b\u7ed9\u7684 demo \uff08\u5982\u4e0b\uff09</li>\n</ul>\n<pre><code>&lt;template&gt;\n  &lt;section&gt;\n    &lt;div v-if=\"$device.isDesktop\"&gt;Desktop&lt;/div&gt;\n    &lt;div v-else-if=\"$device.isTablet\"&gt;Tablet&lt;/div&gt;\n    &lt;div v-else&gt;Mobile&lt;/div&gt;\n  &lt;/section&gt;\n&lt;/template&gt;\n</code></pre>\n<ul>\n<li>\u597d\u50cf\u4e5f\u6ca1\u95ee\u9898\uff0c\u5c31\u62ff\u8fd9\u4e2a\u63d2\u4ef6\u5728 dev \u73af\u5883\u4e0b\u5199\u4e86\u3002\u5728\u5b9e\u9645\u4f7f\u7528\u4e2d\uff0c\u5927\u6982\u91c7\u7528\u4e86\u4ee5\u4e0b\u4e24\u79cd\u5199\u6cd5\uff0c\u4f46\u5728<code>dev</code>\u6a21\u5f0f\u4e0b\u90fd\u80fd\u6b63\u5e38\u5de5\u4f5c</li>\n</ul>\n<pre><code>&lt;Dialog v-if=\"!isMobile\" .../&gt;\n&lt;DialogM v-else .../&gt;\n    \n...\n    \n&lt;Card :class=\"{mobile: isMobile}\" .../&gt;\n</code></pre>\n<ul>\n<li>\u4eca\u5929\u5199\u7684\u5dee\u4e0d\u591a\u4e86\u8bd5\u4e86\u8bd5<code>nuxt generate</code>\uff0c\u53d1\u73b0\u8bbf\u95ee\u65f6\uff0c\u4f7f\u7528\u7b2c\u4e8c\u79cd\u5199\u6cd5\u7684\u7ec4\u4ef6\u4e00\u5f8b\u91c7\u7528\u4e86\u624b\u673a\u7aef\u7684\u6837\u5f0f(\u914d\u7f6e\u9879\u91cc\u9ed8\u8ba4 UA \u662f\u624b\u673a\u7248\u7684)\uff0c\u65e0\u89c6 UA \uff0c\u8fd9\u624d\u53d1\u73b0\u5b98\u65b9\u6587\u6863\u91cc\u5e76\u6ca1\u63d0\u7b2c\u4e8c\u79cd\u5199\u6cd5\uff0c\u4f46\u5b83\u5728<code>dev</code>\u6a21\u5f0f\u4e0b\u786e\u5b9e\u80fd\u6b63\u5e38\u5de5\u4f5c....\u6ca1\u529e\u6cd5\uff0c\u73b0\u5728\u53ea\u80fd\u5c3d\u529b\u586b\u5751\u3002</li>\n<li>\u597d\u5728\u586b\u5751\u4e5f\u4e0d\u7b97\u592a\u96be\uff0c\u53ea\u8981\u628a<code>&lt;Card :class=\"{mobile: isMobile}\" .../&gt;</code>\u6539\u4e3a<code>&lt;Card v-if=\"isMobile\" class=\"mobile\" .../&gt; &lt;Card v-else ...&gt;</code>\u5c31\u884c\u4e86\uff0c\u5199\u6cd5\u662f\u6709\u70b9\u50bb\uff0c\u4f46\u4e5f\u53ea\u80fd\u8fd9\u6837\u5c3d\u91cf\u627e\u8865\u4e86\u3002</li>\n<li>\u957f\u6559\u8bad\u4e86\uff0c\u4e0b\u6b21\u8981\u91c7\u7528\u4e00\u4e2a\u4ec0\u4e48\u65b0\u4e1c\u897f\u65f6\u4e00\u5b9a\u8981\u5145\u5206\u6d4b\u8bd5....</li>\n</ul>\n"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/sunmoon1983", 
        "name": "sunmoon1983", 
        "avatar": "https://cdn.v2ex.com/avatar/912f/cff7/254536_large.png?m=1764747738"
      }, 
      "url": "https://www.v2ex.com/t/1044411", 
      "date_modified": "2024-05-27T09:34:23+00:00", 
      "content_html": "<p>nuxt.config.ts \u4e2d\u7684 ssr \u4e5f\u662f true</p>\n<p>\u81ea\u5df1\u5199\u7684\u540e\u53f0\u63a5\u53e3</p>\n<p>\u9875\u9762\u663e\u793a\u6b63\u5e38\u7684\uff0c\u4f46\u662f\u53f3\u952e\uff0c \u67e5\u770b\u6e90\u4ee3\u7801\u540e\u91cc\u9762\u6ca1\u6709\u8bf7\u6c42\u56de\u6765\u7684\u6570\u636e\u5440\uff01</p>\n<p>\u8fd9\u80fd SEO \uff1f</p>\n<p>nuxt.config.ts \u4ee3\u7801\uff1a</p>\n<pre><code>export default defineNuxtConfig({\n    app: {\n        head: {\n            charset: 'utf-8',\n            viewport: 'width=device-width, initial-scale=1',\n        }\n    },\n    devtools: {enabled: false},\n    //\u5173\u95ed\u9065\u6d4b\u6570\u636e\n    telemetry: false,\n    modules: ['@pinia/nuxt'],\n    css: [\n        \"@/assets/style/style.css\"  //\u914d\u7f6e\u4f7f\u7528\u7684\u6837\u5f0f\n    ],\n    ssr:true,\n})\n</code></pre>\n<p>\u9875\u9762\u4ee3\u7801\uff1a</p>\n<pre><code>&lt;template&gt;\n    &lt;div id=\"body\"&gt;\n        &lt;div class=\"container\"&gt;\n            &lt;div id=\"main\"&gt;\n                &lt;article class=\"post\" v-if=\"_length(row)&gt;0\"&gt;\n                    &lt;h1 class=\"center\"&gt;{{row.title}}&lt;/h1&gt;\n                    &lt;ul class=\"post-meta\"&gt;\n                        &lt;li&gt;\n                            &lt;time&gt;{{dateDisplay(row.created_at)}}&lt;/time&gt;\n                        &lt;/li&gt;\n                        &lt;li&gt;&lt;a :href=\"row.url\"&gt;\u9ed8\u8ba4\u5206\u7c7b&lt;/a&gt;\n                        &lt;/li&gt;\n                        &lt;li&gt;&lt;a&gt;{{row.views}}&lt;/a&gt; \u9605\u8bfb&lt;/li&gt;\n                        &lt;li&gt;&lt;a href=\"#comments\"&gt;\u8bc4\u8bba&lt;/a&gt;&lt;/li&gt;\n                    &lt;/ul&gt;\n        &lt;div class=\"post-content\" v-html=\"row.content\"&gt;&lt;/div&gt;\n        &lt;p class=\"tags\"&gt;\u6807\u7b7e: &lt;a v-for=\"tag in row.tag\" :href=\"getTagUrl(tag)\"&gt;{{tag}}&lt;/a&gt;&lt;/p&gt;\n        &lt;div class=\"post-near\"&gt;\n            &lt;li class=\"post-left\"&gt;\u6ca1\u6709\u4e86&lt;/li&gt;\n            &lt;li class=\"post-right\"&gt;\u6ca1\u6709\u4e86&lt;/li&gt;\n        &lt;/div&gt;\n        &lt;div class=\"clearfix\"&gt;&lt;/div&gt;\n    &lt;/article&gt;\n            &lt;/div&gt;\n        &lt;/div&gt;\n    &lt;/div&gt;\n&lt;/template&gt;\n&lt;script setup lang=\"ts\"&gt;\nimport {onMounted,ref} from \"vue\";\nimport {getArticleDetail} from \"~/api/article\";\nimport type {ApiResponse,ArticleItem} from \"~/types/interface\";\nimport {dateDisplay} from \"~/utils/date\";\nimport {_length} from \"~/utils\";\nimport { useRoute } from '#app';\n\nconst route = useRoute();\nconst params = route.params;\nconst id = ref(params.id);\nconst loading = ref(false);\nconst row = ref&lt;ArticleItem&gt;();\nonMounted(async()=&gt;{\n    await fetchData();\n})\nconst fetchData = async() =&gt;{\n    try {\n        loading.value = true;\n        const data:ApiResponse = await getArticleDetail({id:id.value});\n        if(data.code!==0){\n            return Promise.reject(data.message);\n        }\n        row.value = data.data as ArticleItem;\n        if(_length(row.value.url)===0){\n            row.value.url = '/archives/'+row.value.slug;\n        }\n        useHead({\n            title: row.value.title,\n            meta: [\n                { name: 'description', content: '\u6211\u7684\u795e\u5947\u7f51\u7ad9\u3002' }\n            ],\n            bodyAttrs: {\n                class: 'test'\n            },\n            script: [ { innerHTML: 'console.log(\\'Hello world\\')' } ]\n        })\n    }catch (e) {\n        loading.value = false;\n    }\n}\n&lt;/script&gt;\n&lt;style scoped lang=\"less\"&gt;\n\n&lt;/style&gt;\n\n</code></pre>\n", 
      "date_published": "2024-05-27T09:28:04+00:00", 
      "title": "nuxt3 axios \u8bf7\u6c42\u51fa\u6765\u7684\u6570\u636e\u5728\u6e90\u4ee3\u7801\u4e2d\u6ca1\u6709\u8fd9\u4e5f\u6ca1\u6709\u529e\u6cd5 SEO \u5440\uff1f", 
      "id": "https://www.v2ex.com/t/1044411"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/Jelly427", 
        "name": "Jelly427", 
        "avatar": "https://cdn.v2ex.com/avatar/a447/366c/649693_large.png?m=1774943338"
      }, 
      "url": "https://www.v2ex.com/t/1036929", 
      "date_modified": "2024-04-30T01:37:48+00:00", 
      "content_html": "nuxt \u90e8\u7f72\u5728 cf Page \u4e0a \u60f3\u7528 env \u91cc\u7684\u73af\u5883\u53d8\u91cf<br /><br />\u6216\u8005\u8fd9\u6837\u8bf4 cf \u91cc\u7684\u73af\u5883\u53d8\u91cf \u5982\u4f55\u5728 nuxt \u91cc\u83b7\u53d6<br /><br />\u83dc\u9e1f\u641e\u4e86 2 \u5929\u6ca1\u6210\u529f", 
      "date_published": "2024-04-30T00:49:48+00:00", 
      "title": "nuxt \u90e8\u7f72\u5728 cf Page \u4e0a \u60f3\u7528 env \u91cc\u7684\u73af\u5883\u53d8\u91cf", 
      "id": "https://www.v2ex.com/t/1036929"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/lysddp", 
        "name": "lysddp", 
        "avatar": "https://cdn.v2ex.com/gravatar/7305d9dc9676a495254aa4b833c1c2d0?s=73&d=retro"
      }, 
      "url": "https://www.v2ex.com/t/1030061", 
      "title": "Nuxt \u4e0b\u5927\u5bb6\u5982\u4f55\u505a\u7528\u6237\u8eab\u4efd\u8ba4\u8bc1", 
      "id": "https://www.v2ex.com/t/1030061", 
      "date_published": "2024-04-06T12:11:43+00:00", 
      "content_html": "\u4e4b\u524d\u63a5\u5ba2\u6237\u8eab\u4efd\u8ba4\u8bc1\u90fd\u662f\u76f4\u63a5\u7528 Lemonsqueezy \u83b7\u53d6 License \uff0c\u7136\u540e\u7528\u6237\u8f93\u5165 Licence \u6765\u505a\u8eab\u4efd\u8ba4\u8bc1\u53ca\u8d26\u6237\u6709\u6548\u6027\u9a8c\u8bc1\uff0c\u5bf9\u4e8e chrome Extension \u8fd9\u6837\u5f04\u8fd8\u7b97\u5c06\u5c31\u3002 \u4f46\u662f\u5982\u679c\u60f3\u5f00\u53d1 saas \u7684\u8bdd\uff0c\u4f30\u8ba1\u8fd8\u662f\u5f97\u7528 google \u3001twitter \u3001\u90ae\u7bb1\u7b49\u6765\u505a\u9a8c\u8bc1\u3002Nuxt \u4e0b\u6709\u6ca1\u6709\u5408\u9002\u7684\u8f6e\u5b50\uff0c\u53ef\u4ee5\u6765\u9a8c\u8bc1\u7528\u6237\u8eab\u4efd\u3001\u8d26\u6237\u670d\u52a1\u65f6\u6548\u6027\u7684\u9a8c\u8bc1\u5462\uff1f<br />\u8bf7\u5404\u4f4d\u5927\u4f6c\u8d50\u6559\uff01"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/xiaopanzi", 
        "name": "xiaopanzi", 
        "avatar": "https://cdn.v2ex.com/avatar/a2a3/d5b8/206459_large.png?m=1699876192"
      }, 
      "url": "https://www.v2ex.com/t/1027734", 
      "title": "nuxt \u5b98\u7f51\u9996\u9875\u7684\u6c34\u6ce2\u6548\u679c\u52a8\u753b\u662f\u5982\u4f55\u5b9e\u73b0\u7684\uff1f", 
      "id": "https://www.v2ex.com/t/1027734", 
      "date_published": "2024-03-28T04:52:12+00:00", 
      "content_html": "<p>\u524d\u7aef\u5c0f\u767d\uff0c\u6700\u8fd1\u770b\u5230<a href=\"https://nuxt.com/\" rel=\"nofollow\">nuxt \u5b98\u7f51\u9996\u9875</a>\u7684\u6c34\u6ce2\u6548\u679c\u52a8\u753b\uff08\u53ef\u80fd\u7528\u8bcd\u4e0d\u51c6\u786e\uff09\u4e0d\u9519\uff0c\u8bf7\u95ee\u8fd9\u662f\u5982\u4f55\u5b9e\u73b0\u7684\uff1f\u662f\u5426\u6709\u7ec4\u4ef6\u53ef\u4ee5\u76f4\u63a5\u7528\uff1f</p>\n"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/banliyaya", 
        "name": "banliyaya", 
        "avatar": "https://cdn.v2ex.com/avatar/e066/1f14/411350_large.png?m=1698973471"
      }, 
      "url": "https://www.v2ex.com/t/948585", 
      "title": "nuxt3 \u5728\u4f7f\u7528 nuxt/i18n \u4e4b\u540e\u6253\u5305\u4e2d\u7684\u4f9d\u8d56\u751f\u6210\u8f6f\u94fe\u63a5\u7684\u6587\u4ef6\u5939\uff0c\u5982\u4f55\u8ba9\u5b83\u4e0d\u751f\u6210\u8fd9\u79cd\u6587\u4ef6\u5939\uff1f", 
      "id": "https://www.v2ex.com/t/948585", 
      "date_published": "2023-06-14T02:39:05+00:00", 
      "content_html": "\u5982\u679c\u9879\u76ee\u4e2d\u4f7f\u7528\u4e86 nuxt/i18n \u4e4b\u540e\u5c31\u4f1a\u7528\u5230 acorn \uff0c\u5728\u4f7f\u7528\u4e0d\u7ba1 pnpm/yarn/npm \u6253\u5305\u51fa\u6765\u90fd\u4f1a\u4ea7\u751f\u8fd9\u4e2a\u8f6f\u94fe\u63a5\u6587\u4ef6\u5939\uff0c\u5728 macos \u91cc\u53eb\u66ff\u8eab\uff0c\u5728 windows \u91cc\u53eb\u5feb\u6377\u65b9\u5f0f\u3002\u5982\u4e0b\u56fe\uff1a<br /><a target=\"_blank\" href=\"https://i.imgur.com/m6JlHNr.png\" rel=\"nofollow noopener\" target=\"_blank\"><img src=\"https://i.imgur.com/m6JlHNr.png\" class=\"embedded_image\" rel=\"noreferrer\"></a><br /><br />\u73b0\u5728\u4ea7\u751f\u7684\u95ee\u9898\u662f <br /><br />\u5982\u679c\u6211\u7528 macos \u6253\u5305\u538b\u7f29\u653e\u5230\u670d\u52a1\u5668\u91cc windows \u4e0d\u8bc6\u522b\u8fd9\u4e2a\u6587\u4ef6\u5939 \u65e0\u6cd5\u542f\u52a8\u6210\u529f\u3002<br />\u5982\u679c\u7528 windows \u6253\u5305\u538b\u7f29\u76f4\u63a5\u5931\u8d25\u4e0d\u80fd\u538b\u7f29\u8fd9\u79cd\u683c\u5f0f\u6587\u4ef6\u5939\uff0c\u4e0d\u538b\u7f29\u76f4\u63a5\u4e0a\u4f20\u63d0\u793a\u65e0\u6cd5\u4e0a\u4f20\u8fd9\u79cd\u6587\u4ef6\u5939<br /><br />\u6211\u4eec\u5e76\u6ca1\u6709\u4f7f\u7528 docker \uff0c\u6240\u4ee5\u65e0\u6cd5\u89e3\u51b3\u8fd9\u79cd\u73af\u5883\u7684\u95ee\u9898<br /><br />\u5df2\u7ecf\u5c1d\u8bd5\u5728.npmrc \u4e2d\u6dfb\u52a0 node-linker=hoisted \u914d\u7f6e\uff0c\u5e76\u6ca1\u6709\u8d77\u5230\u4efb\u4f55\u4f5c\u7528<br />nuxt.config \u4e2d\u6dfb\u52a0 vite&gt;resolve&gt;preserveSymlinks=false \u4e5f\u6ca1\u6709\u4efb\u4f55\u4f5c\u7528<br /><br />\u540c\u6837\u7684\u95ee\u9898\u5728 antfu \u7684 demo \u9879\u76ee\u4e2d\u4e5f\u6709\u590d\u73b0<br /><a target=\"_blank\" href=\"https://github.com/antfu/nuxt-movies-demo.git\" rel=\"nofollow noopener\">https://github.com/antfu/nuxt-movies-demo.git</a><br /><br />\u5728 stackoverflow/github \u4e0a\u641c\u7d22\u76f8\u5173\u95ee\u9898\uff0c\u5be5\u5be5\u65e0\u51e0 \u4e5f\u6ca1\u6709\u63d0\u4f9b\u51fa\u89e3\u51b3\u65b9\u6848 \u90fd\u662f\u6ca1\u6709\u4e0b\u6587<br /><a target=\"_blank\" href=\"https://stackoverflow.com/questions/76241682/error-err-module-not-found-cannot-find-package-cookie-es-after-nuxt-3-bui\" rel=\"nofollow noopener\">https://stackoverflow.com/questions/76241682/error-err-module-not-found-cannot-find-package-cookie-es-after-nuxt-3-bui</a><br /><br />\u8bf7\u95ee\u8fd9\u4e2a\u6539\u5982\u4f55\u914d\u7f6e\uff1f"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/rocmax", 
        "name": "rocmax", 
        "avatar": "https://cdn.v2ex.com/gravatar/34078d8614bf9197df6c6de09dfc8e58?s=73&d=retro"
      }, 
      "url": "https://www.v2ex.com/t/940592", 
      "date_modified": "2023-05-17T01:40:54+00:00", 
      "content_html": "<p>\u4e2d\u9014\u53c2\u52a0\u4e86\u4e00\u4e2a\u4f7f\u7528 Nuxtjs(v2.15.7)\u5f00\u53d1\u5ba2\u6237\u7ba1\u7406 APP \u7684\u56e2\u961f\uff0c\u672c\u4eba\u6709 React/Nextjs \u5f00\u53d1\u7ecf\u9a8c\uff0c\u4e00\u5f00\u59cb\u5c31\u662f\u770b\u770b\u6587\u6863\u7167\u732b\u753b\u864e\u5199\u70b9\u9875\u9762\uff0c\u7a0d\u5fae\u6df1\u5165\u4e86\u89e3\u9879\u76ee\u4e4b\u540e\u5bf9\u4e8e\u5982\u4f55\u914d\u7f6e Nuxtjs \u6e32\u67d3\u65b9\u5f0f\u4ea7\u751f\u4e86\u4e00\u70b9\u7591\u95ee\uff0c\u6c42\u6307\u70b9\u3002</p>\n<p>\u9879\u76ee\u5f53\u524d\u7684\u60c5\u51b5\uff1a</p>\n<ul>\n<li>\n<code>nuxt.config.js</code>\u5185\u7684\u76f8\u5173\u914d\u7f6e\u4e3a<pre><code>  ssr: false,\n  target: \"static\",\n  generate: \u672a\u914d\u7f6e\n</code></pre>\n</li>\n<li>Docker \u5316\u65f6\u5019\u7528\u7684\u662f<code>npm run generate</code>,\u542f\u52a8\u547d\u4ee4<code>npm start</code>\u3002\u5e76\u6ca1\u6709\u505a\u53ea\u62f7\u8d1d dist \u76ee\u5f55\u7b49\u51cf\u5c11\u955c\u50cf\u4f53\u79ef\u7684\u4f18\u5316\uff0c\u6240\u6709\u6587\u4ef6\u539f\u5c01\u4e0d\u52a8\u585e\u5230\u955c\u50cf\u91cc\u7136\u540e\u90e8\u7f72\u5230 K8s</li>\n<li>\u4f7f\u7528\u4e86\u52a8\u6001\u8def\u7531(/post/_id),\u800c\u4e14\u53ef\u4ee5\u6b63\u5e38\u663e\u793a</li>\n</ul>\n<p>\u60f3\u95ee\u4e00\u4e0b\u8fd9\u79cd\u60c5\u51b5\u4e0b\u9879\u76ee\u8dd1\u5728\u4f55\u79cd\u6a21\u5f0f\u4e0b\uff08 ssr,ssg,spa \uff09?</p>\n<p>\u4e0b\u9762\u662f\u95ee\u9898\u53d1\u73b0\u7684\u8fc7\u7a0b\uff0c\u6709\u70b9\u957f\uff1a</p>\n<p>\u7531\u4e8e\u8fd9\u4e2a\u9879\u76ee\u90e8\u7f72\u5230 K8s \u800c\u4e0d\u662f CDN \uff0c\u6700\u521d\u6211\u8ba4\u4e3a\u91c7\u7528\u7684\u662f SSR \u6a21\u5f0f\u3002\u5f53\u65f6\u9047\u5230\u4e2a\u60c5\u51b5\u662f\u6bcf\u6b21 CI \u5728 build \u9636\u6bb5\u90fd\u8981\u9488\u5bf9\u4e0d\u540c\u73af\u5883\uff08 dev,test,prod...)\u751f\u6210\u591a\u4e2a\u955c\u50cf\uff0c\u5dee\u522b\u53ea\u662f\u73af\u5883\u53d8\u91cf\u4e0d\u540c\u3002\u6211\u60f3\u76f4\u63a5\u5229\u7528 runtimeConfig \u628a\u8fd9\u4e9b\u53d8\u91cf\u653e\u5230 pod \u91cc\u7684\u8bdd CI \u505a\u4e00\u4e2a\u955c\u50cf\u5c31\u591f\u4e86\u3002\u4f46\u662f\u5c1d\u8bd5\u5931\u8d25\u3002</p>\n<p>\u540e\u6765\u6211\u770b\u4e86 nuxtjs \u914d\u7f6e\u6587\u4ef6\uff0c\u610f\u8bc6\u5230\u6211\u7406\u89e3\u9519\u4e86\uff0c\u9879\u76ee\u91c7\u7528\u7684\u5e94\u8be5\u662f SSG \u65b9\u5f0f\uff0c\u786e\u5b9e\u770b generate \u65e5\u5fd7\u4e5f\u662f\u751f\u6210\u4e86\u6bcf\u4e2a\u9875\u9762\u7684\u6587\u4ef6\uff0c\u9759\u6001\u6587\u4ef6\u7684\u8bdd\u5f53\u7136\u662f\u65e0\u6cd5\u4ece\u73af\u5883\u8bfb\u53d6\u53d8\u91cf\uff0c\u53ea\u6709 build \u9636\u6bb5\u66ff\u6362\u4e86\u3002</p>\n<p>\u518d\u540e\u6765\u6211\u53d1\u73b0\u53e6\u5916\u4e00\u4e2a\u5f00\u53d1\u4eba\u5458\u4f7f\u7528\u4e86 dynamic route(/post/_id \u8fd9\u6837\u7684\u8def\u7531\uff0cid \u662f\u52a8\u6001\u53d8\u5316\u7684\uff0c\u65e0\u6cd5\u5728 build \u65f6\u4ece\u6570\u636e\u5e93\u83b7\u53d6\uff0c\u800c\u4e14 generate \u4e5f\u6ca1\u914d\uff0c\u4e4b\u524d\u5df2\u7ecf\u5f00\u53d1\u7684\u90e8\u5206\u6ca1\u7528\u8fc7\u52a8\u6001\u8def\u7531)\u3002\u6211\u60f3 SSG \u6a21\u5f0f\u4e0b\u52a8\u6001\u8def\u7531\u4f1a\u88ab\u5ffd\u7565\u4e0d\u751f\u6210\uff0c\u6211\u5c31\u63d0\u9192\u4ed6\u8bf4\u53ef\u80fd\u9875\u9762\u6ca1\u6cd5\u7528\u3002\u4f46\u662f\u73b0\u5b9e\u6253\u8138\uff0c\u90e8\u7f72\u540e\u53ef\u4ee5\u6b63\u5e38\u8bbf\u95ee\u3002</p>\n<p>\u4e8e\u662f\u6211\u770b\u4e86\u8bbf\u95ee\u9875\u9762\u65f6\u8fd4\u56de\u7684 html \uff0c\u53d1\u73b0\u6240\u6709\u9875\u9762\u90fd\u53ea\u6709\u4e00\u4e2a<code>id=\"__nuxt\"</code>\u8282\u70b9\uff0c\u8fd9\u79cd\u60c5\u51b5\u5e94\u8be5\u662f fallback \u5230 SPA \u4e86\u5427\uff0c\u611f\u89c9\u662f\u6bcf\u4e2a\u9875\u9762\u88ab\u5355\u72ec\u505a\u6210\u4e86\u4e00\u4e2a SPA \uff1f\u5982\u679c\u662f\u8fd9\u6837\u7684\u8bdd generate \u5c31\u5b8c\u5168\u662f\u591a\u4f59\u7684\u3002</p>\n<p>\u90a3\u4e48\uff0c<code>npm start</code>\u542f\u52a8 Nuxt \u670d\u52a1\u5668\u7684\u65f6\u5019\u5230\u5e95\u662f\u5982\u4f55\u5904\u7406\u7684\uff1f\u4f1a\u68c0\u67e5\u5df2\u7ecf generate \u597d\u7684\u6587\u4ef6\u5417\uff1f</p>\n", 
      "date_published": "2023-05-17T01:37:30+00:00", 
      "title": "\u5982\u4f55\u786e\u5b9a Nuxtjs \u5f53\u524d\u7684\u6e32\u67d3\u6a21\u5f0f\uff1f", 
      "id": "https://www.v2ex.com/t/940592"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/PqgpNgA0wk", 
        "name": "PqgpNgA0wk", 
        "avatar": "https://cdn.v2ex.com/avatar/6567/2678/240401_large.png?m=1760188318"
      }, 
      "url": "https://www.v2ex.com/t/910662", 
      "title": "nuxt3 \u8bf7\u6c42\u6570\u636e\u7684\u6700\u4f73\u5b9e\u8df5\u662f\u4ec0\u4e48", 
      "id": "https://www.v2ex.com/t/910662", 
      "date_published": "2023-01-25T23:12:22+00:00", 
      "content_html": "<p>\u6700\u8fd1\u624d\u5f00\u59cb\u5b66 nuxt3 \uff0c\u6570\u636e\u8bf7\u6c42\u4e0a\u611f\u89c9\u548c\u4e4b\u524d\u5199 vue \u6709\u4e9b\u4e0d\u592a\u4e00\u6837\uff0c\u5f88\u591a\u6559\u7a0b\u91cc\u4f7f\u7528 useFetch \u4e4b\u7c7b\u7684\u8981\u4e48\u662f\u8c03\u4e00\u4e2a\u793a\u4f8b url \uff0c\u8981\u4e48\u662f\u8c03 server \u76ee\u5f55\u91cc\u7684\u63a5\u53e3\uff0c\u5982\u679c\u662f\u5bf9\u63a5\u540e\u7aef\u540c\u4e8b\u7684\u63a5\u53e3\uff0c\u96be\u9053\u628a\u5df2\u6709\u7684\u63a5\u53e3\u8981\u81ea\u5df1\u5f80 server/api \u76ee\u5f55\u91cc\u518d\u5199\u4e00\u904d\u561b\uff0c\u4f46\u662f\u5c01\u88c5\u7684\u8bdd\uff0cuseFetch \u4e4b\u7c7b\u7684\u53ea\u80fd\u5199\u5728 setup \u91cc\uff0c\u7814\u7a76\u8fd9\u4e9b\u6587\u6863\u5934\u90fd\u5927\u4e86\ud83d\ude05\n\u6709\u6ca1\u6709\u5df2\u7ecf\u6709\u9879\u76ee\u7ecf\u9a8c\u7684\u5927\u4f6c\u6559\u4e0b\u600e\u4e48\u5904\u7406\u6570\u636e\u8bf7\u6c42\u5c01\u88c5 /api \u7edf\u4e00\u7ba1\u7406</p>\n"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/AJQA", 
        "name": "AJQA", 
        "avatar": "https://cdn.v2ex.com/gravatar/ac0edffcf1da3215e2826be161920b39?s=73&d=retro"
      }, 
      "url": "https://www.v2ex.com/t/828834", 
      "date_modified": "2022-01-17T10:37:24+00:00", 
      "content_html": "<p>\u73b0\u5728\u60f3\u6765\u8fd8\u4e0d\u5982 extjs \u5b83\u6709\u90a3\u79cd\u70b9\u4e00\u4e0b\u5f00\u4e00\u4e2a\u5b83\u81ea\u5df1\u7684\u65b0\u6807\u7b7e \u6807\u7b7e\u53ef\u5173\u95ed \u4e0d\u662f\u6d4f\u89c8\u5668 tab </p>\n<p>\u5177\u4f53\u7684\u53eb Ext.BoxComponent</p>\n<p>extjs2.1 \u7248</p>\n<p>\u8fd9\u6837\u6bcf\u6b21\u70b9\u51fb\u8d85\u94fe\u63a5\u5c31\u4f1a\u65b0\u5f00\u4e00\u4e2a\u57fa\u4e8e iframe \u7684 tab \u539f\u9875\u9762\u5b8c\u5168\u4e0d\u53d7\u5f71\u54cd \u4e5f\u662f\u4e1d\u822c\u987a\u6ed1</p>\n<p>\u771f\u7684 \u540e\u6094\u4e86 \u56e0\u4e3a vue nuxt \u6d6a\u8d39\u4e86\u592a\u591a\u65f6\u95f4</p>\n", 
      "date_published": "2022-01-17T10:37:12+00:00", 
      "title": "\u7528 nuxtjs vue \u5f00\u53d1\u7684\u4e00\u4e2a\u540e\u53f0\u7cfb\u7edf \u540e\u6094\u4e86 \u8fd8\u4e0d\u5982\u7528 extjs", 
      "id": "https://www.v2ex.com/t/828834"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/freak118", 
        "name": "freak118", 
        "avatar": "https://cdn.v2ex.com/avatar/8d30/223e/276391_large.png?m=1550139201"
      }, 
      "url": "https://www.v2ex.com/t/804904", 
      "title": "nuxt \u600e\u4e48\u76f4\u63a5\u67e5\u8be2\u6570\u636e\u5e93\u7136\u540e\u7ed9\u9875\u9762\u63d2\u503c\u5462\uff1f", 
      "id": "https://www.v2ex.com/t/804904", 
      "date_published": "2021-09-28T07:27:50+00:00", 
      "content_html": "\u5728 server-middleware \u91cc\u80fd\u5efa\u7acb\u94fe\u63a5\u548c\u67e5\u8be2\u5230 \u4f46\u662f\u5982\u4f55\u63d2\u503c\u5230\u9875\u9762\u4e0a\u5462"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/121819756", 
        "name": "121819756", 
        "avatar": "https://cdn.v2ex.com/gravatar/2e9b057b28d7d81dfaaf88a4d1711f0b?s=73&d=retro"
      }, 
      "url": "https://www.v2ex.com/t/795174", 
      "date_modified": "2021-08-11T12:19:49+00:00", 
      "content_html": "<p>Nuxt \u80fd\u4e0d\u80fd\u7ed3\u5408 generate \u548c build \u4e24\u79cd\u65b9\u5f0f\uff1f\u5c31\u662f\u6211\u60f3\u6307\u5b9a\u751f\u6210\u67d0\u4e2a page \u4e0b\u9762\u7684\u6587\u4ef6\uff0c\u5176\u4ed6\u90fd\u662f\u8d70 build\uff0cstart \u8fd9\u79cd\uff0c \u8fd8\u6709 generate \u751f\u6210\u51fa\u6765\u7684\u8def\u5f84\u90fd\u4e0d\u6b63\u786e\u662f\u4e3a\u4ec0\u4e48\uff1f</p>\n", 
      "date_published": "2021-08-11T12:19:15+00:00", 
      "title": "Nuxt \u80fd\u4e0d\u80fd\u7ed3\u5408 generate \u548c build \u4e24\u79cd\u65b9\u5f0f\uff1f", 
      "id": "https://www.v2ex.com/t/795174"
    }, 
    {
      "author": {
        "url": "https://www.v2ex.com/member/yunyuyuan", 
        "name": "yunyuyuan", 
        "avatar": "https://cdn.v2ex.com/avatar/4220/854d/533960_large.png?m=1715396552"
      }, 
      "url": "https://www.v2ex.com/t/793656", 
      "title": "\u5c45\u7136\u6709 nuxtjs \u7684\u8282\u70b9\u4e86\uff0c\u5206\u4eab\u4e00\u4e0b\u6211\u7684\u57fa\u4e8e nuxtjs \u7684\u535a\u5ba2\u5427", 
      "id": "https://www.v2ex.com/t/793656", 
      "date_published": "2021-08-04T08:51:37+00:00", 
      "content_html": "<a target=\"_blank\" href=\"https://github.com/yunyuyuan/cloudflare-blog\uff0c\u4e5f\u6b22\u8fce\u4e92\u94fe\" rel=\"nofollow noopener\">https://github.com/yunyuyuan/cloudflare-blog\uff0c\u4e5f\u6b22\u8fce\u4e92\u94fe</a>"
    }
  ]
}