Overview
v2 refocuses on schema-driven admin features (AutoForm, SearchForm, DataTable and API) and removes components that overlap with Nuxt UI or offer little reuse value. This guide covers the behavior changes and replacements to check during the upgrade.
Upgrade Steps
- Check runtime requirements. Verify the supported versions, then update dependencies and the lockfile. See Runtime and API.
- Replace removed features. Check the component and type replacements and AutoForm controls.
- Review behavior changes. Check Forms, Table and Locale and the API migration table.
- Verify the migration. Run the project's lint, type checks, tests and build, then check the workflows your project uses.
Migrate with AI
Open your coding assistant in the project root, then expand and copy the prompt or ask the assistant to read the Markdown version of this page. The prompt uses v1.8.3 as its baseline and asks the assistant to check for earlier v1 changes when they apply.
Upgrade this project from @movk/nuxt v1 to v2. Preserve its business workflows, data formats and interactions.
Start with the project instructions, package.json, lockfile, Nuxt or Vite configuration, app.config, app entry point and CI configuration. Identify the installed v1 version, the target v2 version, the package manager and whether the project uses Nuxt or Vue + Vite. Verify this checklist against the target version's source, type declarations and migration guide. If the project predates v1.8.3, also check changes between the installed version and v1.8.3. List affected files and the expected changes for each applicable item, then update the features the project uses.
References
- Movk Nuxt migration guide https://nuxt.mhaibaraai.cn/en/docs/getting-started/migration
- Documentation index https://nuxt.mhaibaraai.cn/llms.txt
- API migration table https://nuxt.mhaibaraai.cn/en/docs/api#migrating-from-v1-to-v2
- Nuxt Auth Utils migration guide https://nuxt.com/modules/auth-utils#migrate-from-v05
- Nuxt Site Config v5 changes https://github.com/harlan-zw/nuxt-site-config/releases/tag/v5.0.0
Migration checklist
1. Runtime and dependencies
- Align Node.js in development, CI and deployment with ^22.22.3 || ^24.15.0 || >=26.0.0. Nuxt mode requires Nuxt ^4.6.4. Use compatible Nuxt UI 4 (4.13.0 or later) and Zod 4 (4.3.6 or later). Update dependencies and the lockfile with the project's package manager.
- In Vue + Vite projects, check @movk/nuxt/vite, virtual:movk-plugins and the CSS entry. API integration, file transfers and streaming require Nuxt. Keep a single Tailwind CSS entry with @import "@movk/nuxt".
- If the project pins reka-ui directly, align it with the target Nuxt UI version. If it directly uses nuxt-site-config, tailwind-variants or related modules, check major-version changes to configuration and types. Movk Nuxt removed maska and colortranslator, so keep them as direct dependencies if project code uses them.
2. Removed components, types and themes
- Search templates, imports, component types and theme configuration using the project's component prefix. Replace WithClear, WithCopy, WithPasswordToggle, WithCharacterLimit, WithFloatingLabel and AsPhoneNumberInput by composing Nuxt UI input components.
- Replace PillGroup with URadioGroup, UCheckboxGroup, UToggleGroup or UTabs according to whether it selects one value, selects multiple values or switches panels. Compose UColorPicker with UPopover for ColorChooser. Use UPopover or useMessageBox().confirm for Popconfirm. Provide a replacement for SlideVerify that preserves the verification workflow.
- Check v-model bindings, events, slots, accessibility and styling in replacement wrappers. Remove legacy component type imports and theme entries.
3. AutoForm and SearchForm
- Find withClear, withCopy, withPasswordToggle, withCharacterLimit, withFloatingLabel, asPhoneNumberInput, colorChooser, slideVerify and pillGroup in schemas. Use existing controls and controlProps for simple cases. Register custom controls with defineControl and pass them via controls when you need to preserve enhanced interactions.
- Replace AutoForm's :state with v-model, type the bound state with z.input, and check submit handlers against the schema's output type. reset() restores the baseline plus schema defaults. clear() retains only the defaults. Both update the bound object in place, and AutoForm emits a state snapshot. Call setBaseline() after loading an existing record to set the reset target.
- Check how conditional rendering affects nested objects, layout fields, validation and submitted values. Fields hidden by meta.if are excluded from validation. hiddenValue controls whether their values are cleared from the model, with field settings taking precedence. Review validation and submit handlers that rely on hidden fields.
- Use v-model:expanded to control SearchForm expansion, or defaultExpanded for the initial state. Submission trims strings and drops empty strings, null and undefined while preserving 0 and false. Use :transform-payload="false" or supply a custom function when the raw values matter. Review the complete schema field set emitted by reset/clear, including cleared values represented as undefined, especially when merging filters into an existing object. SearchForm renders supported leaf fields and skips object, array and layout fields.
- Adopt asyncItems, array item moves and duplication, toggle / toggleGroup, and isDirty / dirtyFields where needed. With syncQuery in Nuxt or Vue Router, verify initial restore, back and forward navigation, list refresh on query-restore, and whether updates replace or add history entries.
4. DataTable and Tree
- Replace confirmText / cancelText / confirmButtonProps / cancelButtonProps in table action confirmations with confirmLabel / cancelLabel / confirmButton / cancelButton. Rewrite paginationUi.text as complete templates using empty, total, range, rangeUnknown, selected and pageSize. Check the pagination docs for placeholders.
- Verify client and server pagination, tree expansion, row selection and infinite scrolling. For key arrays that control selection, expansion and column visibility, check the relevant v-model bindings and initial values. Check the skeleton shown when an empty table loads. Set skeletonRows: 0 for UTable's default loading style. A supplied loading slot takes precedence.
- Adopt columnSettings, persistKey and CSV export where needed. exportCsv only processes data supplied to the table. To export all matching records with server pagination, use exportServerCsv and serverCsvExport with the page's external filters.
- Verify Tree's parent-child selection, disabled nodes, selection and expansion before and after searching, and retries after lazy loading fails. Use the leaf strategy, searchMethod / searchDebounce, reload(), getNode(), loadError and searchError where needed.
5. Locale, dates and themes
- AutoForm, SearchForm, DataTable, Tree, DatePicker and MessageBox use the UApp locale with an English fallback. Set <UApp :locale="zh_cn"> to retain Chinese text. Use extendMovkLocale or existing component props to customize text.
- Enable movk.zod validation localization where needed. locale: 'auto' follows UApp on the client and uses fallback on the server. The customError set by movk:zod:config applies only to AutoForm and SearchForm in the current app. In Vue + Vite, configure zod.customError through the Vue plugin options. Check direct Zod calls and custom error maps.
- Without an explicit locale, useDateFormatter uses the UApp locale and falls back to en outside components. Verify that toDate preserves hours, minutes and seconds for values with a time, and that convertData preserves native Date objects and class instances. Use v-model:open to control DatePicker popovers. popoverProps.defaultOpen initializes uncontrolled state. Check open() / close(), negative time zones, month and year displays, field size and disabled state.
- Check custom theme prefixes, neutral palettes and initial colors under SSR. If your project uses a custom component prefix, also verify imperative calls through useMessageBox.
6. API, authentication and file transfers (Nuxt)
- Find $api (including .use, .raw and .stream), useApiFetch and its variants, uploads, downloads, chat transport and movk:api:* hooks. Replace skipBusinessCheck / skipUnwrap with the inverse businessCheck / unwrap flags. Omitted options inherit the endpoint and global configuration. Move these options and toast from $api context to the top level of the request options.
- Business-code validation and dataKey unwrapping are independent. For endpoints returning a bare array or object, set businessCheck: false and unwrap: false in endpoints.<name>.response. Override endpoint defaults per request where needed. Custom onRequest / onResponse handlers run after built-in hooks. Set unwrap: false when a handler needs the raw response body.
- Check ApiError.data?.kind for business, http, network, timeout or aborted, and read data.code and data.response where needed. Update code that uses FetchError, isBusinessError, error.response or treats error.data as the response body. movk:api:error takes (context, error) and reports at most once after retries finish. User-initiated cancellation skips error reporting. Verify 401s, toasts, retries and SSR authentication.
- Rename upload timeoutMs to timeout. Uploads and downloads inherit endpoint publicHeaders and request hooks. Injected authorization headers take precedence over ordinary headers. Disabling business-code validation alone still unwraps the response. Check download progress when Content-Length is absent, JSON error responses and cancellation. SSE and chat transport read streams, and JSON errors follow the endpoint policy.
- For nuxt-auth-utils sessions upgrading from v0.5 to v0.6, follow the upstream guide for session configuration, server helpers and deployment. Set NUXT_APP_SECRET in production, remove NUXT_SESSION_PASSWORD and runtimeConfig.session.password, and plan for users to sign in again. Report required environment variable names and keep secret values in the deployment environment.
7. Documentation and AI integration
- Update Movk Nuxt doc links in the project. Former composable pages are grouped by feature, SearchForm is under AutoForm, file transfers and streaming are under API, and MCP, llms.txt and Skills are under AI Integration.
Run the project's existing lint, type checks, tests and build. Recheck affected workflows such as form submission, pagination, authentication or file transfers. Report changed files, verification results, manual deployment steps and anything you could not verify.
Removed Components
| Component | Replacement |
|---|---|
MWithClear | Compose UInput, see the Nuxt UI Input example |
MWithCopy | Compose UInput, see the Nuxt UI Input example |
MWithPasswordToggle | Compose UInput, see the Nuxt UI Input example |
MWithCharacterLimit | Compose UInput, see the Nuxt UI Input example |
MWithFloatingLabel | Compose UInput, see the Nuxt UI Input example |
MAsPhoneNumberInput | Compose UInput, see the Nuxt UI Input example |
MPillGroup | Choose URadioGroup / UCheckboxGroup with variant="card", UToggleGroup or UTabs according to the interaction |
MColorChooser | UColorPicker inside a UPopover |
MSlideVerify | No built-in replacement; implement your own or use a third-party human verification service |
MPopconfirm | Confirm buttons inside a UPopover, or the imperative useMessageBox |
The maska and colortranslator dependencies are removed as well, along with the Props / Emits / Slots type exports of these components (such as WithClearProps, PillGroupProps and ColorChooserProps).
Removed AutoForm Control Types
The following type values are no longer built in. Using them renders a [AutoForm] No control mapped notice:
withClear,withPasswordToggle,withCopy,withCharacterLimit,withFloatingLabel,asPhoneNumberInputcolorChooser,slideVerify,pillGroup
For simple cases, configure existing controls through controlProps. To retain an enhanced input, wrap it in a project component, register it with defineControl and pass controls to the form. A custom control can keep its original type name.
const schema = afz.object({
// Before: afz.string({ type: 'withPasswordToggle' })
password: afz.string({ controlProps: { type: 'password' } }),
// Before: afz.enum([...], { type: 'pillGroup' })
category: afz.enum(['All', 'Frontend', 'Backend'], {
type: 'radioGroup',
controlProps: { orientation: 'horizontal' }
})
})
import PasswordInput from '~/components/PasswordInput.vue'
const { afz, controls } = useAutoForm({
withPasswordToggle: defineControl({
component: PasswordInput,
controlProps: { class: 'w-full' }
})
})
See Controls for details.
Runtime and API
| Dependency | Required version |
|---|---|
| Node.js | ^22.22.3 || ^24.15.0 || >=26.0.0 |
| Nuxt (Nuxt mode) | ^4.6.4 |
| Nuxt UI | 4.13.0 or a later compatible v4 version |
| Zod | 4.3.6 or a later compatible v4 version |
For a standalone Vue project, check the Vue / Vite setup.
Forms, Table and Locale
- AutoForm binding. Bind input state with
v-modeland type it withz.input. The old:statestill works and emits a development deprecation warning. - Reset and clear.
reset()restores the baseline plus schema defaults.clear()keeps only schema defaults. Both update the bound object in place and emit a snapshot. CallsetBaseline()after loading a record to make it the reset target. - SearchForm. Bind expansion with
v-model:expanded. Submit payloads trim strings and drop empty values by default. Set:transform-payload="false"to keep the original payload. - DataTable. Action confirmations use
confirmLabel,cancelLabel,confirmButtonandcancelButton. Pagination uses complete templates with the keysempty,total,range,rangeUnknown,selectedandpageSize. - Locale. Component text and
useDateFormatterfollow the UApp locale with an English fallback. Set the UApp locale or pass a formatter locale when needed. - DatePicker.
v-model:opentakes precedence overpopoverProps.open.popoverProps.defaultOpeninitializes uncontrolled state. Migrate existing controlled state tov-model:openbefore callingopen()orclose().
Documentation Paths
The docs are reorganized by capability. Old links redirect automatically:
/docs/composables/*is split into the matching sections:useAutoForm→ Forms,useTheme→ Theme,useMessageBox/useDateFormatter→ their component pages, upload/download and streaming → API- The AutoForm field type pages are merged into Field Types, and
SearchFormmoves into the Forms section - The three AI integration pages are merged into AI Integration