Comments (2)
This is a personal preference. Some prefer having the modal in the template so it is easier for the modal to track changes on props, others prefer having it in the script so it doesn't appear in the template.
A lot of usecases exist, and I know that for most of them, I would use a higher order component (a new component that has for root an <UModal />
) so that I can reuse UModal
props, and extend it with my own props.
I'm not a fan of programmatically opened modals, but I know for sure this is the most convenient way to open one or another modal depending on a condition that could be declared in a function.
Also, note that when opening modals programmatically, your modal component needs to have UModal
as the root component because useModal().open()
passes the props to UModal
.
from ui.
Thanks @noook for your answer! I accept the idea of passing own props.
Also, note that when opening modals programmatically, your modal component needs to have
UModal
as the root component becauseuseModal().open()
passes the props toUModal
.
That's my point: If I'm forced to have a UModal
, why not take away the need to write the code? 😉
Anyhow, I will find a workaround or create a relatively empty higher order component!
Thanks for your time and continue the great work 💪
from ui.
Related Issues (20)
- Table: how to sort rows based on a boolean value? Only strings seem to work?
- Error ERROR Pre-transform error: Failed to resolve import "#tailwind-config/theme/colors" HOT 4
- Adding overflow hidden to avatar HOT 1
- Breadcrumb aria-current value HOT 1
- When using the Tabs component, there is no line break on the mobile phone HOT 6
- [Alert] Base icon style does not apply
- SelectMenu placeholder color HOT 1
- Problem when working with more than one modal HOT 1
- The description in the UlandingHero component cannot display the line breaks from the YAML text. HOT 1
- Dropdown supports nesting HOT 1
- size prop from FormGroup not passed down via app.config? HOT 2
- Notifications not working with ssr : false HOT 5
- Pattern to display a chip conditionally? HOT 2
- Better app config theme auto-complete HOT 6
- Notifications (Toast) do not work with NUXT v3.12.1 & SSR disabled HOT 1
- useToast (Notification) is not working with Nuxt 3.12.1 HOT 1
- `useToast()` notifications doesn't work when server side rendering is disabled HOT 1
- UInput Component Fails to Handle File Input Correctly HOT 2
- Expose the type `Column` from the table
- When UTabs are insade USlideover it has no enter transition HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ui.