vimeshjs / vimesh-ui

Vimesh UI is an ultra lightweight library to build UI components for Alpine.js
MIT License
125 stars 5 forks source link

template with script tag, and import-html-entry library usage #10

Open ericxin1982 opened 9 months ago

ericxin1982 commented 9 months ago

Hi @xinjie-zhang , @vimeshjs

The $api need to be defined inside script tag, and I probably would use import-html-entry to load html file dynamically, not sure how to bypass this, would you please help thinking about it? Is it a problem?

Thanks Eric Xin

xinjie-zhang commented 9 months ago

You could load html from anywhere, then use x-shtml (an enhanced replacement of x-html) to mount it, or use vimesh ui global api $vui.setHtml(htmlParentElement, htmlContent) in your javascript code. Actually, x-shtml internally use $vui.setHtml