diff --git a/src/runtime/composables/useUI.ts b/src/runtime/composables/useUI.ts index 59e58eed..2e38479a 100644 --- a/src/runtime/composables/useUI.ts +++ b/src/runtime/composables/useUI.ts @@ -4,7 +4,7 @@ import { useAppConfig } from '#imports' import { mergeConfig, omit, get } from '../utils' import { Strategy } from '../types' -export const useUI = (key, $ui: Ref | undefined>, $config?: Ref | T, $wrapperClass?: Ref) => { +export const useUI = (key, $ui: Ref | undefined>, $config?: Ref | T, $wrapperClass?: Ref, withAppConfig: boolean = false) => { const $attrs = useAttrs() const appConfig = useAppConfig() @@ -12,11 +12,12 @@ export const useUI = (key, $ui: Ref | und const _ui = toValue($ui) const _config = toValue($config) const _wrapperClass = toValue($wrapperClass) + return mergeConfig( _ui?.strategy || (appConfig.ui?.strategy as Strategy), _wrapperClass ? { wrapper: _wrapperClass } : {}, _ui || {}, - process.dev ? get(appConfig.ui, key, {}) : {}, + (process.dev || withAppConfig) ? get(appConfig.ui, key, {}) : {}, _config || {} ) })