
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
A mini mvvm lib with virtual dom - mini-vdom.
基于 virtual dom - mini-vdom 的轻量级 mvvm 库 >_<#@!
适用于 ui 组件的构建依赖或小型项目,如果项目比较复杂,也许一个更加成熟的 mvvm 框架及其生态更适合你 🤠🤠
npm install mini-mvvm --save
包含了 .d.ts 文件,用起来毫无阻塞 >_<#@!
npm run dev:mini-mvvm 开发调试
npm run build 生产构建
data、computed 变动监听push | pop | shift | unshift | splice | sort | reversecomputed 计算属性文本节点 数据绑定,可以是一段表达式attribute 数据绑定
m-model 双向绑定。 支持 input、textarea、selectm-if 条件渲染。条件支持 data、computed、一段表达式m-for 循环。(item,index) in array、item in array@click | @mousedown | ... 。可以使用 $event 占位原生事件watch 数据监听,详见下方示例
created 组件创建成功,可以使用 this 得到 MVVM 的实例beforeMount 将要被插入 dommounted 组件被添加到 dom,可以使用 this.$el 获取根节点 dombeforeUpdate 组件将要更新updated 组件更新完毕import MVVM from 'mini-mvvm'; // es module, typescript
// const MVVM from 'mini-mvvm'; // commonjs
// const MVVM = window['MiniMvvm']; // window
new MVVM({
// 挂载的目标节点的选择器
// 如果没有 template,就用这个节点作为编译模板
el: '#app',
template: `
<div id="app">
<div>{{ content }}</div>
</div>
`,
// data
data() {
return {
content: 'this is content.'
};
},
computed: {}, // ...计算属性
// ...hook,可以使用 this
created() {
// 使用api方式去watch
this.$watch('key', (val, oldVal) => {}, { immediate: true });
},
mounted() {}, // ...hook,可以使用 this.$el
methods: {}, // ...方法
// ...数据监听
watch: {
// 声明方式1:
watch1(val, oldVal) {},
// 声明方式2:
watch2: {
immediate: true, // 立即执行
handler(val, oldVal) {}
}
}
});
FAQs
A mini lib to achieve mvvm. 一个轻量级的mvvm库。
We found that mini-mvvm 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
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.