We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
customEvent + web component
The text was updated successfully, but these errors were encountered:
html:
<xq-button> 我是按钮 </xq-button> <script> const button = document.querySelector('xq-button'); button.addEventListener('xq:click', function() { console.log('button click') }); </script>
react:
import React, { useState, useRef, useEffect } from "react"; import useXqEvent from '@xqui/use-xq-event'; import '@xqui/button'; function ReactXqButtonDemo() { const [theme, setTheme] = useState('default'); const button = useRef(); useXqEvent(button, [{ event: 'xq:click', handler: function() { console.log('click button') setTheme('primary') } }]) return ( // @ts-ignore <xq-button ref={button} theme={theme}>hhh</xq-button> ) } export default ReactXqButtonDemo;
Sorry, something went wrong.
see demo
No branches or pull requests
customEvent + web component
The text was updated successfully, but these errors were encountered: