Is it possible to use Aurelia in a non-spa application?

荒凉一梦 提交于 2019-12-07 07:11:39

问题


Recently I've been playing around with different frameworks and libraries, looking for something that really suits my needs.

You see, my job mainly involves creating asp.net mvc applications and for most of them using Razor and a little bit of jQuery is enough. But in certain cases and only for a few pages,which are rarely more than one or two per app, I really need something extra that helps me avoid getting entangled in a bunch of jQuery code.

As I mentioned, I tried a couple of alternatives and from them, the one I liked the most is Aurelia, because of its simplicity and the fact that it embraces standards, BUT the more I dive into the framework, the more I think that it might not be what I'm looking for,as it seems more suitable for full spa applications and what I need is:

  • Something that helps me reduce the amount of DOM manipulation
  • A efficient templating engine

I know that Aurelia provides that and much more, but I don't want/need a SPA, I need those functionalities ONLY in some specific pages and not the whole application.

Can Aurelia help me achieve this? If so, how?


回答1:


Sure, Aurelia can help you achieve that. You just won't use certain features like routing in on the pages you create with Aurelia.

That being said, it isn't a drop in replacement for jQuery, but none of the "modern" JS frameworks really are. And you're going to end up spending time learning whichever one you end up choosing.

Check out the aurelia.enhance functionality, it might be just what you're looking for!




回答2:


I have used Aurelia in a non-SPA context, and it worked out well. I think this is exactly what you describe. For example:

http://legumeinfo.org/chado_phylotree/phytozome_10_2.59028020

https://github.com/legumeinfo/tripal_phylotree/tree/lis_master/theme/js/aurelia




回答3:


I'm using aurelia for dynamic elements on some sites. Like comments for example. Page loads fast w/o comments.Then Aurelia kicks in and loads the comments below. Also with some signalR magic the discussion is updated in real time. It is awesome and insanely easy.



来源:https://stackoverflow.com/questions/41029089/is-it-possible-to-use-aurelia-in-a-non-spa-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!