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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Why Choose Vue.js

156 点作者 jgalvez将近 8 年前

26 条评论

linkmotif将近 8 年前
I really don&#x27;t get how separating templates is a good thing. Been there, done that. Not going back. Not going back to separate CSS either. Because having everything together is great. Not to mention using JS for render logic. That&#x27;s great too. It&#x27;s what I always wanted. People kept pushing &quot;best practices&quot; on me—like not using the style attribute, separating templates—and I am so grateful for the people at Facebook for ending that.<p>Like most articles about Vue.js—and I keep looking because I keep wanting to understand the appeal—there&#x27;s never a clear explanation regarding why separating templates and not using JS for render logic is good. Maybe it&#x27;s a matter of taste. For me, having everything about a component in one place is very convenient and simplifies abstraction and composability.<p>Maybe I just need to try Vue.js to understand the draw. That was true for me with React. But React was a totally new paradigm for me. Vue.js seems like a combination of several familiar paradigms in a way that doesn&#x27;t really make sense having gone React.
评论 #14621583 未加载
评论 #14621569 未加载
评论 #14622166 未加载
评论 #14621716 未加载
评论 #14621646 未加载
评论 #14621753 未加载
评论 #14635334 未加载
评论 #14621935 未加载
graysonk将近 8 年前
Love the article! But wow this site hurts my eyes. Yellow and red font on a black background aligned very far right?
评论 #14622164 未加载
评论 #14621752 未加载
评论 #14621703 未加载
评论 #14621580 未加载
评论 #14621593 未加载
sjroot将近 8 年前
I embraced Vue after making multiple attempts to digest the React platform with little success. I have found that Vue&#x27;s templating system and APIs have brought so much clarity to the complex projects that I set out to build, and would highly recommend it to anyone. It is my hope that React may learn from some of Vue&#x27;s triumphs.
nkg将近 8 年前
I initiated the adoption of Vue.js in our agency about a year ago and we never had to regret it. One positive aspect that I didn&#x27;t expect is that the architecture of Vuejs apps kind of forces you to write cleaner code: methods, states, mutations, every piece has its own place.
murukesh_s将近 8 年前
Remarkable that Vue.js (Single dev) is holding up well against React. I was recommending Vue.js to others while react was the craze. It somehow felt more cleaner to me and the performance, if I am not wrong was on par or better than React.
评论 #14621726 未加载
评论 #14622418 未加载
vyrotek将近 8 年前
We love Vue at our company. I&#x27;m personally a fan of how Vue separates and handles templates.<p>That said, it was a bit difficult to read this article on a fullscreen monitor since it&#x27;s aligned to the far right.
评论 #14621503 未加载
ausjke将近 8 年前
So, I was told to separate html, css and js into different files and such, now web components, vuejs are saying no let us mix three into one component instead. IMHO, too much abstraction kills productivity, I am choosing vuejs and polymer for future projects, yes I like to mix html&#x2F;css&#x2F;js together and make them components for reuse.
invalid_将近 8 年前
&quot;specialising in UI&#x2F;UX work with both React and Vue&quot;.. &quot;rare occasions I needed to write javascript in the past 5 years&quot;..<p>Hmmm
评论 #14621851 未加载
Exuma将近 8 年前
This color scheme gives me extreme anxiety... good article though.
ajoy将近 8 年前
Previously used Vue and switched back to React. I have a few gripes about Vue for larger projects. Most have to do with a lack of &#x27;namespacing&#x27; or ability to isolate functions.<p>1. Plugins - Eg. Recently VueResource plugin was deprecated, but i had a hard time finding out where all the plugin was being used. The dependencies were hard to figure out.<p>2. Functions introduced in Plugins added to a parent component are inherited in all the child components&#x27; &#x27;namespace&#x27;. It was hard for me to determine if a function that I am writing has a naming conflict with a plugin function, until runtime.<p>3. Since this dependency is not obvious, a new dev looking at a piece of code that is using some functionality inserted by a plugin, needs to be aware of all plugins that have been interjected at any of it’s parent level components and the functions they introduce.<p>4. Mixins help with re-use code, but can lead to potential function naming conflicts.<p>Maybe I was doing things wrongly w&#x2F; Vue. If so, any recommendations are welcome.
StreamBright将近 8 年前
Is this a CSS joke that backend people won&#x27;t get? Or why does this site look like a 90s parody of web standards? I am not sure if I can take him seriously over which JS framework to use just by judging on his site.
评论 #14622719 未加载
sebringj将近 8 年前
&quot;no need to bind methods&quot;, that&#x27;s true but just letting you know its not a thing if you use es6 arrow functions.<p>class SomeClass extends React {<p><pre><code> someMethod = () =&gt; { &#x2F;&#x2F; already bound } }</code></pre>
评论 #14621894 未加载
nickthemagicman将近 8 年前
I think Front End development is so insane because Front End dev is chained to the browser and javascript&#x2F;css implementation by the browser makers. With web assembly, hopefully browser developers can separate from making languages and instead make language targets. Then the separately developed language can stay stable while its underlying implementation can adapt to the dumb browser madness. Then we can have some sanity in web development. It&#x27;s what we are trying to do now with all the maddening layers of transpilation.
mpalmer将近 8 年前
&gt; In React, you need to use the setState() to trigger rendering updates as you modify the state. In Vue, you simply assign things to this and, if necessary, the component&#x27;s automatically rerendered. You do need to provide an initial state (data) for safety.<p>Hoo boy. &quot;Simply&quot; assign directly to `this`! This may come down to preference for&#x2F;against functional tools, but on this point Vue loses big for me. Seems way less testable...
评论 #14626005 未加载
wintorez将近 8 年前
I was very interested in Vue.js initially, but I had to pass once I realized it uses two-way data-binding. I prefer React.js since it has less behind the scene magic than Vue.js or Angular. Although I like certain aspects of Vue.js which I think React could learn from.
评论 #14621622 未加载
评论 #14621564 未加载
评论 #14621625 未加载
评论 #14621531 未加载
评论 #14623501 未加载
评论 #14621579 未加载
评论 #14621530 未加载
评论 #14621732 未加载
评论 #14626040 未加载
QuotesDante将近 8 年前
This guy really ought to read [Practical Typography](<a href="http:&#x2F;&#x2F;practicaltypography.com&#x2F;" rel="nofollow">http:&#x2F;&#x2F;practicaltypography.com&#x2F;</a>).
评论 #14622271 未加载
luketheobscure将近 8 年前
Almost all of his arguments are also true for Ember.js, with the notable exception of compatibility with &quot;web components&quot; (but there&#x27;s Glimmer for that).
attrezzarturo将近 8 年前
JSX being transformed into JS allows you to test your logic (minus brower&#x2F;acceptance testing) in node, even if you load css and do weird stuff with webpack. I am not looking at anything else until that is true for &lt;put your backbone&#x2F;angular evolution here&gt;.
评论 #14622476 未加载
dmix将近 8 年前
This site doesn&#x27;t render properly for me on latest Chrome (dev) on Linux.<p><a href="http:&#x2F;&#x2F;imgur.com&#x2F;a&#x2F;umXXB" rel="nofollow">http:&#x2F;&#x2F;imgur.com&#x2F;a&#x2F;umXXB</a>
评论 #14622419 未加载
评论 #14622446 未加载
scyclow将近 8 年前
The two tabs on your website overlap on my 15&quot; screen. I think you might need to do .left { left: 100px } instead of .left { right: 740px }
评论 #14622534 未加载
terenceng2010将近 8 年前
Using vue without webpack or any build process becomes a maintenance issue when you got dozens of x-template in a single html file.
评论 #14621905 未加载
yavi将近 8 年前
I&#x27;ve used Vue.js in projects for the better part of a year now and have enjoyed it, for the most part. It&#x27;s easier to grasp, is very usable right out of the box without any build tools, and the documentation is solid. I&#x27;ve mostly used vanilla Vue without Vuex or other dedicated state management (so I can&#x27;t speak well to how that would improve the experience), but my gripes with it so far have mostly been:<p>- Less explicit behavior leads to more magic. There are few if any &#x27;gotchas&#x27; with the React component lifecycle. If state changes in the component or in its ancestry, React will re-render unless you explicitly tell it not to, every time. There&#x27;s a performance trade-off to this, but for most applications it&#x27;s not a problem, and you can handle it explicitly. By contrast, Vue decides when to update components, and its algorithm works perfectly 95% of the time. The other 5% of the time I find myself writing workarounds with watchers, and it&#x27;s a frustrating experience. Additionally, while Vue 2 got rid of many magic variables, there are still a few that can lead to confusing behavior. For example, the magic variable &#x27;$event&#x27; for emitted event data is needed only when the event handler uses other variables too - otherwise it&#x27;s included for you automatically. It&#x27;s convenient, sure, but I&#x27;ve seen more than a few developers get tripped up by the ergonomics of Vue&#x27;s magic. There are also a number of gotchas around handling reactivity in arrays.<p>- Size of community. While the community is certainly existent and growing, you&#x27;re still far more likely to find what you&#x27;re looking for in the React community. Additionally, much of what exists for Vue is written for the Chinese community, which sometimes means less-than-ideal English documentation. This should change over time but it&#x27;s something to consider in the present.<p>- <i>Everything</i> in Vue is reactive, which has added some real performance overhead for us in some pathological cases.<p>- This is purely personal preference, but I&#x27;ve never been quite sold on extensions to HTML for templating. It might be a bias from working with React but I prefer HTML-in-JS to JS-in-HTML.<p>As for the points the article brought up: - Explicitly bound methods: Sure, but this isn&#x27;t a React thing, that&#x27;s how ES6 classes work. If the extra line or two per method is that troubling React.createClass() inserts all that magical binding for you. - State management: I don&#x27;t really find setState all that difficult to use. By contrast, Vue requires that all class properties for the component be setup initially. If you decide to add one later, Vue will simply ignore it unless you use Vue.$set() to register the property as a reactive one. - Mixins: This is certainly a controversial topic, but I tend to agree with the React team, at least when it comes to larger codebases: <a href="https:&#x2F;&#x2F;facebook.github.io&#x2F;react&#x2F;blog&#x2F;2016&#x2F;07&#x2F;13&#x2F;mixins-considered-harmful.html" rel="nofollow">https:&#x2F;&#x2F;facebook.github.io&#x2F;react&#x2F;blog&#x2F;2016&#x2F;07&#x2F;13&#x2F;mixins-cons...</a> . Mixin-like functionality is possible with either library, regardless. - Templating: I don&#x27;t find the overhead of either JSX or Vue templates to be problematic after spending a day or two with either. My experience has been that developers with a background in Angular gravitate towards Vue templates as they have a similar DSL. The biggest differences to me seem to be that Vue templates are slightly easier to read while React templates offer the full flexibility of JS.<p>Don&#x27;t let any of this detract you from Vue - I&#x27;ve enjoyed using it and would recommend giving it a shot. Despite the caveats I&#x27;ve encountered with it there&#x27;s certainly good reason for its recent popularity!
isaac739将近 8 年前
&quot;if the main application code is under 1000 lines, keep it in a single file&quot;<p>NOPE. I like .vue because you can easily avoid large files.
jgalvez将近 8 年前
Alright guys, updated stylesheet and color scheme due to popular demand :)
pyedpiper将近 8 年前
taking frontend framework advice from a website that is arguably uglier and more poorly laid out than the bulk of geocities pages is a tough pill to swallow.
评论 #14621982 未加载
lapsock将近 8 年前
web development is such a retarded mess<p>its really amazing how much effort is spent on building the same CRUD apps over and over again
评论 #14621899 未加载
评论 #14621968 未加载
评论 #14622497 未加载