quasar-skilld
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesequasarframework/quasar quasar
quasarquasarframework/quasar quasar
quasarVersion: 2.18.6 (Nov 2025)
Tags: legacy: 1.22.10 (May 2023), latest: 2.18.6 (Nov 2025)
References: Docs — API reference, guides • GitHub Issues — bugs, workarounds, edge cases • GitHub Discussions — Q&A, patterns, recipes • Releases — changelog, breaking changes, new APIs
**版本:**2.18.6(2025年11月)
**标签:**旧版:1.22.10(2023年5月),最新版:2.18.6(2025年11月)
参考资料:文档 — API参考、指南 • GitHub问题 — 缺陷、解决方法、边缘情况 • GitHub讨论 — 问答、模式、实践方案 • 版本发布 — 更新日志、破坏性变更、新API
API Changes
API变更
This section documents version-specific API changes — prioritize recent major/minor releases.
-
BREAKING:-> uses
v-model+model-valueinstead of@update:model-value+valuein Vue 3 source@input -
BREAKING:/
QDrawer/QDialog/QMenu-> useQTooltipandclassattributes instead ofstyle/content-classprops sourcecontent-style -
BREAKING:-> completely redesigned, removed
QImgandtransitionprops; renamedbasictono-default-spinnersourceno-spinner -
BREAKING:-> methods
QScrollAreareturnsgetScrollPosition;{ top, left }andsetScrollPositionrequiresetScrollPercentageparameter sourceaxis -
BREAKING:-> renamed
QTableprop todatato avoid TS naming conflicts sourcerows -
BREAKING:-> all boolean properties now explicitly
Platform.isinstead offalsesince v2.17.0 sourceundefined -
BREAKING:utils ->
colorsandgetBrandreplaced bysetBrandandgetCssVarrespectively sourcesetCssVar -
BREAKING: Scroll utils -> renamedto
getScrollPosition,getVerticalScrollPositiontoanimScrollTo, andanimVerticalScrollTotosetScrollPositionsourcesetVerticalScrollPosition -
BREAKING:utils ->
dateandaddToDateproperty names normalized (e.g.,subtractFromDate->year,years->month) sourcemonths -
BREAKING:-> must now use the default slot with
QPopupEditfor performance sourcev-slot="scope" -
BREAKING:directive -> removed; use router reference (
GoBackor$router.back()) instead source$router.go(-1) -
NEW:composable -> primary method for accessing the
useQuasarobject within Composition API components$q -
NEW:composable -> new way to define meta tags, replacing the now deprecated
useMetacomponent property sourcemeta -
NEW:props -> added
QTable,table-row-style-fn,table-row-class-fn, andgrid-style-fnin v2.18.0 sourcegrid-class-fn
Also changed: new composable · props , , new v2.17.0 · prop new v2.17.0 · prop new v2.17.0 · / new v2.18.0 · new flag v2.18.0 · model-value no longer contains prop · prop new · props , , new · plugin custom component props moved to · plugin uses for HTML content instead of · wrapper removed · modifier replaced by
useFormChild()QOptionsGroupoption-valueoption-labeloption-disableQUploaderthumbnail-fitQSelectdisable-tab-selectQMenuQBtnDropdownno-esc-dismissevt.qAvoidFocusQDatechangedQPaginationgutterQImgloadingcrossoriginfitDialogcomponentPropsLoadinghtml: truesanitizeApp.vue<div id="q-app">.syncv-model:propName本部分记录特定版本的API变更 —— 优先关注近期的主要/次要版本更新。
-
破坏性变更:在Vue 3中,改为使用
v-model+model-value,替代原有的@update:model-value+value来源@input -
破坏性变更:/
QDrawer/QDialog/QMenu—— 改为使用QTooltip和class属性,替代原有的style/content-class属性 来源content-style -
破坏性变更:—— 完全重新设计,移除了
QImg和transition属性;将basic重命名为no-default-spinner来源no-spinner -
破坏性变更:—— 方法
QScrollArea返回getScrollPosition;{ top, left }和setScrollPosition需要setScrollPercentage参数 来源axis -
破坏性变更:—— 将
QTable属性重命名为data,以避免TS命名冲突 来源rows -
破坏性变更:—— 自v2.17.0起,所有布尔属性现在显式为
Platform.is,而非false来源undefined -
破坏性变更:工具函数 ——
colors和getBrand分别被setBrand和getCssVar取代 来源setCssVar -
破坏性变更:滚动工具函数 —— 将重命名为
getScrollPosition,getVerticalScrollPosition重命名为animScrollTo,animVerticalScrollTo重命名为setScrollPosition来源setVerticalScrollPosition -
破坏性变更:工具函数 ——
date和addToDate的属性名称标准化(例如subtractFromDate->year,years->month) 来源months -
破坏性变更:—— 现在必须使用默认插槽
QPopupEdit以提升性能 来源v-slot="scope" -
破坏性变更:指令 —— 已移除;请改用路由引用(
GoBack或$router.back()) 来源$router.go(-1) -
新增:组合式函数 —— 在组合式API组件中访问
useQuasar对象的主要方法$q -
新增:组合式函数 —— 定义元标签的新方式,取代现已弃用的
useMeta组件属性 来源meta -
新增:属性 —— 在v2.18.0中新增了
QTable、table-row-style-fn、table-row-class-fn和grid-style-fn来源grid-class-fn
**其他变更:**新增组合式函数 · v2.17.0新增属性、、 · v2.17.0新增属性 · v2.17.0新增属性 · v2.18.0新增/的 · v2.18.0新增标志 · 的model-value不再包含属性 · 新增属性 · 新增属性、、 · Dialog插件的自定义组件属性移至 · Loading插件使用处理HTML内容,替代原有的 · 移除的包装器 · 用取代修饰符
useFormChild()QOptionsGroupoption-valueoption-labeloption-disableQUploaderthumbnail-fitQSelectdisable-tab-selectQMenuQBtnDropdownno-esc-dismissevt.qAvoidFocusQDatechangedQPaginationgutterQImgloadingcrossoriginfitcomponentPropshtml: truesanitizeApp.vue<div id="q-app">v-model:propName.syncBest Practices
最佳实践
-
Useinstead of
#q-app/wrappersfor defining configurations and boot files — provides superior type inference and alignment with modern Quasar CLI sourcequasar/wrappers -
Use Regle as the recommended validation library forand
QInput— provides a robust, externalized validation logic compared to inline rules sourceQField -
Prefer responsive CSS classes (e.g.,,
gt-sm) over thelt-mdplugin in JavaScript — minimizes re-renders and layout shifts by leveraging CSS media queries directly sourceScreen -
Bootstrap custom dialog components with thecomposable — handles the complex internal communication and lifecycle requirements of the Dialog plugin automatically source
useDialogPluginComponent -
Enable theprop on
no-transitionwhen rendering large datasets — significantly improves runtime performance by skipping expensive expansion/collapse animations sourceQTree -
Use Quasar'sand
useIntervalcomposables over native browser timers — ensures automatic cancellation and memory cleanup when the component is unmounted sourceuseTimeout -
Placeas a direct child of
QPullToRefreshwhen usingQPage— ensures correct scroll event interception and native-like pull behavior within the layout container sourceQLayout -
Avoid settingmode to
Darkin SSR applications — prevents the "flicker" effect where the server renders light mode before the client synchronizes with system preferences sourceauto -
Do not usewith
v-modelcomponents — the active state is derived directly from the current route, and manual model updates will not trigger navigation sourceQRouteTab -
Prefer the Loading Bar Plugin over manualcomponent instances — provides a simpler, globally managed progress indicator for all Ajax calls without per-page wiring source
QAjaxBar
-
定义配置和启动文件时,使用而非
#q-app/wrappers—— 这能提供更出色的类型推断,且与现代Quasar CLI保持一致 来源quasar/wrappers -
为和
QInput推荐使用Regle作为验证库 —— 相较于内联规则,它能提供更健壮、可外部化的验证逻辑 来源QField -
优先使用响应式CSS类(例如、
gt-sm)而非JavaScript中的lt-md插件 —— 通过直接使用CSS媒体查询,减少重渲染和布局偏移 来源Screen -
使用组合式函数引导自定义对话框组件 —— 它能自动处理Dialog插件复杂的内部通信和生命周期要求 来源
useDialogPluginComponent -
渲染大型数据集时,为启用
QTree属性 —— 通过跳过昂贵的展开/折叠动画,显著提升运行时性能 来源no-transition -
使用Quasar的和
useInterval组合式函数替代原生浏览器计时器 —— 确保组件卸载时自动取消计时器并清理内存 来源useTimeout -
使用时,将
QLayout作为QPullToRefresh的直接子元素 —— 确保在布局容器内正确拦截滚动事件,实现类原生的下拉行为 来源QPage -
在SSR应用中避免将模式设置为
Dark—— 防止出现“闪烁”效果,即服务器先渲染浅色模式,之后客户端再与系统偏好设置同步 来源auto -
不要将与
v-model组件一起使用 —— 激活状态直接由当前路由派生,手动更新模型不会触发导航 来源QRouteTab -
优先使用Loading Bar插件而非手动实例化组件 —— 它无需每页配置,就能为所有Ajax请求提供更简单、全局管理的进度指示器 来源
QAjaxBar