-
-
Notifications
You must be signed in to change notification settings - Fork 55
feat(config): global config support #165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for anu-vue ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Hi 👋🏻 I noticed this PR has changes from another PR #156 Is it possible to update the PR so that I can review only relevant changes? Awaiting your response. |
You're saying to update PR #156 to get the zIndex issue out of this PR, right? |
Alright, I will manage while reviewing both PR 👍🏻 |
Hey, I checked this PR and it looks really nice. I really appreciate the efforts you put into it. I have something thoughts to share and we might have to discuss a few things before merging this PR. I hope that won't take much of your time. To make sure we are on the same page, I want to let you know that the global config support we are trying to add in anu is similar to vuetify 3's global config. This way users can add global defaults for components like settings default variant for the alert to <AConfig :defaults={ menu: { trigger: 'hover' } }>
<!-- menu component usage -->
</AConfig> |
This is great, I tried the |
I'm out of the town atm but I will update the PR as soon as I'll be able to work on it. |
provideFn(configProviderContextKey, context) | ||
|
||
provideFn(zIndexContextKey, computed(() => context.value.zIndex)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey 👋🏻
While I was working on AConfig
(same as AConfigProvider
but also for component props) I had issue where if I update the config it also get updated upwards in DOM tree due to reactivity. Then I asked antfu & he suggested me directly passing new ref in provide
instead of updating the value. While I was reviewing this PR for new release, I notices you are doing the same thing to avoid updating config in DOM upwards of AConfigProvider
, Am I right?
excalidraw graph: props-defaults-explanation.excalidraw.zip
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried the trick and it seems its working 🤯
I'll merge AConfigProvider & AConfig in this PR if possible!
We can now configure the zIndex property in the following two ways:
app.use(anu)
ConfigProvider
component