TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: JavaScript framework that plays nice with bootstrap and jquery

1 点作者 rob001超过 7 年前
I&#x27;m currently developing a typical CRUD app with bootstrap and various jquery libraries (datatables, select2...). My backend is ASP.Net MVC, which I love, and my frontend is pure jquery, which i don&#x27;t. I&#x27;m using the revealing module pattern to organise the jquery and i&#x27;m following best practices, so the code is fairly clean. The only issue i&#x27;m having is maintaining a list of cached selectors and binding them all, creating lots of boilerplate, which is messy to modify.<p>I&#x27;ve worked with angular and i really like the data-driven approach, though angular doesn&#x27;t play nice with jquery and you need another library on top of it to work with bootstrap, which is apparently feature incomplete. I&#x27;ve looked at vuejs, and because of the virtual DOM, it doesn&#x27;t go well with libraries that manipulate the real DOM directly. The solution to this is to get modified vue-friendly versions of libraries, which is a road im not keen to go down. React seems like it has similar problems.<p>Is there any js framework that plays nice with bootstrap and jquery and would be better to work with than pure jquery?

2 条评论

andraaspar超过 7 年前
I have had success combining old jQuery based components with a Mithril based UI (Mithril is similar to Vue, but simpler). But this only worked because I defined clear boundaries between areas managed by Mithril and areas managed by jQuery. Nesting such areas was possible. It was possible to make them both notify the other when they were about to remove a nested area.<p>Deleting an element created by the other framework however is never a good idea. They can manage their own event handlers and metadata only themselves. Instead, you need to ask the other framework to detach itself. You can use jQuery&#x27;s special events to detect elements about to be removed from the DOM [0]. Mithril lets you define an onremove lifecycle callback on any component. From there, it is cakewalk.<p>[0] <a href="https:&#x2F;&#x2F;stackoverflow.com&#x2F;a&#x2F;10172676&#x2F;2492826" rel="nofollow">https:&#x2F;&#x2F;stackoverflow.com&#x2F;a&#x2F;10172676&#x2F;2492826</a>
daleholborow超过 7 年前
I&#x27;m looking at Aurelia and really think it has potential