Closed aditio-eka closed 8 months ago
The latest updates on your projects. Learn more about Vercel for Git โ๏ธ
Name | Status | Preview | Updated (UTC) |
---|---|---|---|
ui | โ Ready (Inspect) | Visit Preview | Sep 28, 2023 11:58am |
Awesome! Why did you mark this as breaking change?
Awesome! Why did you mark this as breaking change?
Because I encountered an error when trying to run pnpm dev
, I guess it's caused by the new arguments of useUI
. When I saw the error message, it seemed like some components in @nuxt/ui-pro
are using useUI
. We should update these components to match the new arguments of useUI
.
Oh yes indeed, I'll update @nuxt/ui-pro
with this PR to fix the typecheck!
I was wondering, since you defined
class
asstring
, this prevents the use of arrays and objects. Does this mean we have to implement what Vue does by default? https://vuejs.org/guide/essentials/class-and-style.html#binding-html-classes
I tested assigning objects and arrays to the class prop, and it transformed them into strings automatically.
Ok, so we just need to fix the types right?
What type should we fix?
I see, I didn't encounter a type error when I tested it in the playground. Maybe my VS Code has an issue. Yes, we should update class
type. Do you have any suggestions on how to implement it? I'm not familiar with using runtime declarations; I usually use generic type arguments.
I guess we can define the class
prop as such:
class: {
type: [String, Object, Array] as PropType<string | Record<string, unknown> | Array<string>>,
default: undefined
}
I guess we can define the
class
prop as such:class: { type: [String, Object, Array] as PropType<string | Record<string, unknown> | Array<string>>, default: undefined }
I just updated the class
prop type using unknown
. I followed the type from Vue in here. What do you think, @benjamincanac ? Should we define the type explicitly?
Looks good! I'll finish the update of @nuxt/ui-pro
so we can merge this ๐
Actually, it might be best to define those with any
:
class: {
type: [String, Object, Array] as PropType<any>,
default: undefined
},
Otherwise, I get TS errors once module is built. What do you think?
Actually, it might be best to define those with
any
:class: { type: [String, Object, Array] as PropType<any>, default: undefined },
Otherwise, I get TS errors once module is built. What do you think?
I think it's okay since the class
prop is normalized by Vue.
@aditio-eka Just made this so we can pass the config as a computed
: fc321c8
(#745)
Should we update the T
type or is it fine?
I guess we can update the $config
type of useUI
to Ref<T> | T
.
Thanks for the PR! ๐
๐ Linked issue
https://github.com/nuxt/ui/issues/742
โ Type of change
๐ Description
Resolves https://github.com/nuxt/ui/issues/742. There are two main changes:
class
instead of the fallthrough attribute because the fallthrough attribute isn't reactive.Read more
toRef
to retain reactivityRead more
๐ Checklist