Comments (3)
There's a couple of ways to interact with Alpine components from outside of them.
The cleanest is to send custom events (dispatchEvent(new CustomEvent('my-event'))
) and listen to that event on the Alpine side.
You can also find the root DOM node and read/write the Alpine.js state at .__x.$data
from kutty.
I know what you are saying, it's annoying for me too to build the dialog component in the same place as the trigger.
But I don't think there is a way to separate those for now. I'll ask some alpine people about how to make it better.
Also checkout headlessui which will I'm thinking of using once it's released.
I'll keep this issue open until we find a solution.
from kutty.
For reference, here's a good article on how to trigger custom events from outside: https://tonylea.com/setting-alpine-data-outside-of-the-component
from kutty.
Related Issues (20)
- Error in tailwinds-intellisense HOT 8
- Can Kutty be used with Vite? HOT 2
- Open dialog creates scroll bar HOT 10
- Tooltips show up twice after some time HOT 2
- Page with multiple dialogs HOT 2
- Choose expand direction of dropdown HOT 1
- Not compatible with Windicss HOT 1
- No Badge class styles HOT 5
- Can't click buttons in drawer on mobile Safari HOT 2
- Support for Alpine 3.0 HOT 1
- Support for Apline.js 3.x.x? HOT 2
- No issue, Just lot of love. HOT 1
- error on collapse HOT 1
- Suggestion: Decouple framework specific aspects. HOT 2
- Not working in tailwind.config.js Says could not find a declaration for module kutty HOT 4
- Update tailwindcss to latest HOT 1
- 97 dependancies
- Is Alpine V3 Support Still Coming?
- autoprefixer warning
- Site Link broken 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 kutty.