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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Ask HN: JavaScript Framework to use with pre-existing HTML

3 点作者 goddamnyouryan超过 5 年前
I have a project that allows users to enter an arbitrary URL and make simple modifications to the HTML structure.<p>Right now I am doing this all by hand using ES6 but it&#x27;s starting to get a bit unwieldy.<p>React, Vue.js, Angular etc are primarily focused on generating a complete project, HTML JS and CSS that can be used as an application.<p>I want to just add some functionality to existing arbitrary HTML, but I&#x27;d like to do it in a somewhat modern fashion (things like backbone are at least somewhat better suited to this, but way out of fashion).<p>It seems like Vue might be my best bet but I just wanted to see if anyone else had any suggestions.

3 条评论

masterofmisc超过 5 年前
Not sure if it fits your use-case, but if you just want to just throw a couple of react classes on your page, without having to go through all the hassle of setting up a react app (without NPM or WebPack), you could just live transpile react using babel-standalone.<p><a href="https:&#x2F;&#x2F;babeljs.io&#x2F;docs&#x2F;en&#x2F;babel-standalone" rel="nofollow">https:&#x2F;&#x2F;babeljs.io&#x2F;docs&#x2F;en&#x2F;babel-standalone</a><p>Apparently sites like JSFiddle use babel standalone for live compilation.<p>Here is a GitHub Gist example: <a href="https:&#x2F;&#x2F;gist.github.com&#x2F;OceanAirdrop&#x2F;52b2042da21ef52ac5ead0e9e67197d3" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;OceanAirdrop&#x2F;52b2042da21ef52ac5ead0e...</a><p>Just remember to wrap your script tags with the &quot;text&#x2F;babel&quot; type
Porthos9K超过 5 年前
What&#x27;s wrong with jQuery? It might be old and busted, but people have been testing and debugging it for years. As JS frameworks go, I&#x27;ve found that it&#x27;s the best of a bad lot since you can use what you need with existing markup and CSS instead of having to rebuild to accommodate the framework.
verdverm超过 5 年前
Vue