
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
轻量级玩具 响应式 JSX/TSX 框架
vvix 可以让你使用:
vvix brings you:
挂载 App 根组件到 id 为 root 的 dom 节点上
render App on the dom whose id is "root"
import {createApp} from 'vvix'
const App = () => () =>
<div>hello world</div>
createApp(<App />).mount("#root")
基础的计数器
Simple counter demo
const Counter = () => {
const counter = ref(0)
const click = () => {
counter.value++
}
return () => <div onClick={click}>
counter: {counter.value}
</div>
}
createApp(<Counter />).mount("#app")
组件的嵌套
parent and child components
interface Props {
title: string;
content: string;
}
const enum Status {
Success,
Pending,
Fail,
Normal
}
const Item: FC<Props> = ({ title, content }) => () => (
<div>
<h1>{title}</h1>
<p>{content}</p>
</div>
);
const MsgItem = () => {
const [status, data, retry] = useRequest<
Array<{ id: number; title: string; content: string }>
>();
return () => (
<>
<button onClick={retry}>retry</button>
{
status.value === Status.Pending
? "loading..."
: status.value === Status.Fail
? "oops, something wrong !"
: data.value?.map((item) => (
<Item
key={item.id}
title={item.title}
content={item.content}
/>
))
}
</>
);
};
组件传送门(让组件挂载在其它 dom 上)
portal(mount the component on another dom)
import { createPortal } from "vvix";
const Portal = createPortal<{
msg: string;
}>(({ msg }) => {
return () => <div>{msg}</div>;
}, "#portal");
const App = () => {
return () => (
<div>
<Portal msg="portal render success" />
</div>
);
};
挂载根组件到 dom 上
mount root component on the dom
/*
nodeOps: an plain object which includes some platform apis, for example:
{
getElement(parent, child) {
return parent.querySelector(child)
},
appendChild(parent, child) {
parent.appendChild(child)
},
...
}
if you just want to render it on the dom, just don't care the second parameter
*/
createApp(vnode: VNode, nodeOps?: NodeOps).mount(container: Dom | string)
ref(value?)
reactive(obj)
const count = ref(0);
count.value++
console.log(cont.value) // update render
const state = reactive({
list: [],
users: {}
})
state.list.push({ msg: hello }) // update render
import {expose, onMounted} from 'vvix'
const Child = () => {
const count = ref(0)
expose({
count: count
})
return <div>child</div>
}
const Parent = () => {
const childComponent = ref()
onMounted
}
作者大学生佛系更新,欢迎提出好的 PR/issue 和 star ^_^
I won't guarantee when will it be finished, welcome you PR, issue and Star ^_^
github: https://github.com/JSerFeng/vvix
FAQs
a lite vue-like reactive jsx framework
The npm package vvix receives a total of 5 weekly downloads. As such, vvix popularity was classified as not popular.
We found that vvix demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.