我想reactivityTransform在 Nuxt 3 (3.0.0-rc.3) 中啟用 Vue 3 實驗功能。我已經嘗試過這里提供的解決方案,但它不起作用,我確實收到以下錯誤:
Type '{ vue: { reactivityTransform: true; }; }' is not assignable to type 'UserConfig'.
這是我的nuxt.config.ts檔案:
import { defineNuxtConfig } from "nuxt";
export default defineNuxtConfig({
vite: {
vue: {
reactivityTransform: true
}
},
});
知道我做錯了什么嗎?如何reactivityTransform在 Nuxt 3 中啟用?
uj5u.com熱心網友回復:
nuxt.config顯然在當前版本的 Nuxt 3 (3.0.0-rc.3) 中,我們應該添加一個實驗屬性,而不是修改檔案中的 vite 配置;reactivityTransformNuxt 3 中啟用了以下代碼:
// nuxt.config.ts
import { defineNuxtConfig } from "nuxt";
export default defineNuxtConfig({
experimental: {
reactivityTransform: true
},
});
這是相關鏈接。
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/486816.html
標籤:Vue.js nuxt.js Vuejs3 nuxtjs3
