Tailwind/Nuxt 问题 - 元素之间的内联空间丢失

问题描述 投票:0回答:1
css vuejs3 tailwind-css nuxtjs3
1个回答
0
投票

默认情况下,Vue 会编译带有压缩空格的 SFC。要更改此行为,请编辑

nuxt.config.ts

export default defineNuxtConfig({
  vue: {
    compilerOptions: {
      whitespace: 'preserve'
    }
  }
})

仅供参考,当不使用 Nuxt 时,所需的配置更改在

vite.config.ts

中略有不同
export default defineConfig({
  plugins: [
    vue({
      template: {
        compilerOptions: {
          whitespace: 'preserve'
        }
      }
    })
  ]
})
© www.soinside.com 2019 - 2024. All rights reserved.