跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[程序员] 最小的响应式 UI 框架 Van.js,大家用过吗?

发表于

官网: https://vanjs.org/

简单来说,这个框架允许以下面的方式来创建 DOM 树,方法名等于标签名,并且可以嵌套。

const element = div({ class: 'box' },
    '文本内容 01', '文本内容 02', button('按钮名称')
)

示例如下:

import van from 'vanjs-core'

const { div, button } = van.tags

const App = () => {
    return div(
    	button({ class: 'btn btn-success' }, 'Click Me')
    )
}

van.add(document.body, App())

可以通过 const myValueState = van.state(value) 来创建状态值,通过 myValueState.val 来访问和修改状态值。

用了一段时间了,感觉特点就是特别的轻量简约,基本不需要配置环境,安装依赖包后就可以导入使用,还有个特点就是创建出来的 DOM 树直接就是原生的,整体上很有极客风范。

小项目拿来折腾还是很好玩的,不知道大家有没有使用过的,感觉怎么样。

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.