这是我到目前为止尝试过的:
\n通过安装npm install postcss-nesting --save-dev
设置 vite.config.js:
\nimport { fileURLToPath, URL } from 'url';\nimport { defineConfig } from 'vite';\nimport vue from '@vitejs/plugin-vue';\nimport postcssNesting from 'postcss-nesting';\n\nexport default defineConfig({\n plugins: [\n vue(),\n postcssNesting\n ],\n \n resolve: {\n alias: {\n '@': fileURLToPath(new URL('./src', import.meta.url))\n }\n }\n});\nRun Code Online (Sandbox Code Playgroud)\n但它\xe2\x80\x99s 不起作用。设置 PostCSS 以便我可以使用 CSS 嵌套的正确方法是什么\xe2\x80\x99?
\n