Skip to main content

CurateClick

github.com favicon

babel-plugin-direactive

一个Babel插件,为React开发者提供类似Vue的模板指令(如r-if、r-for等),使React代码更简洁易读,特别适合熟悉Vue的前端开发者。

Check out babel-plugin-direactive on CurateClick

• Copy the embed code to showcase this product on your website

• Share on X to spread the word about this amazing tool

一个babel插件,可以让React模板表达对熟练Vue的前端开发者更友好### 项目地址:https://github.com/wangzongxu/babel-plugin-direactive### 举例- 使用指令之前jsxfunction Component() { return ( <section> { isLoadong ? <div>Loading...</div> : error ? <div>{error}</div> : shopList.length > 0 ? ( <ul> { shopList.map(shop => ( <li key={shop.id}> <h5>{shop.name}</h5> <ul style={{ display: isShowProducts ? 'block' : 'none' }}> { shop.productList.map(product => ( <li key={product.id}> <h6>{product.name}</h6> </li> )) } </ul> </li> )) } </ul> ) : <div>Empty</div> } </section> )}- 使用指令之后jsxfunction Component() { return ( <section> <div r-if={isLoadong}>Loading...</div> <div r-else-if={error}>{error}</div> <ul r-else-if={shopList.length > 0}> <li r-for="shop in shopList" r-key="shop.id"> <h6>{shop.name}</h6> <ul r-show={isShowProducts}> <li r-for="product in shop.productList" r-key="product.id"> <h6>{product.name}</h6> </li> </ul> </li> </ul> <div r-else>Empty</div> </section> )}### 支持的指令- r-if- r-else-if- r-else- r-for/r-key- r-show- r-html- r-text- r-pre- r-model

Latest Weekly Picks

Predict video virality before you publish.

Virality Predictor

Powerful Motion Control AI Video Generator

Motion Control AI

PlusGO 是面向中国大陆用户的 ChatGPT Plus 代充值服务平台。使用官方 CDKey,支持支付宝和微信扫码支付,平均 2 分钟完成 Plus 开通,自 2025 年起已为超过 10,000 名用户完成充值。

www.toolcenter.ai favicon
Weekly Pick

Discover the Best AI & Productivity Tools — 1,500+ tools with honest reviews.

ToolCenter
huntereyes.net favicon
Weekly Pick

AI Eye Area Evaluation

Hunter Eyes
www.payforchat.com favicon
Weekly Pick

Subscribe to ChatGPT Plus/Pro in 1 minute — no international credit card needed.

PayForChat
happyhorseai.ai favicon
Weekly Pick

Happy Horse AI Creates Videos with Motion and Storytelling

Happy Horse
promptbuilder.cc favicon
Weekly Pick

Generate, optimize, test, and manage AI prompts in one place. Turn an idea into a ready-to-use prompt in seconds.

Prompt Builder