
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@xxx=yyy
事件绑定, 可以任意节点上直接使用类似vue事件绑定
的这种写法, 就可实现事件绑定。组件被移出文档时, 事件会自动销毁, 无须手动销毁。@click.stop=xxx
事件绑定支持修饰符:xxx=yyy
, 属性绑定, 类似vue
,在属性前加上:
, 该属性不再使用setAttribute()
, 而是直接赋值, 可满足你需要传递复杂数据结构的需求。#animation={type}
, 开箱即用的动画配置, 内置6种动画fade(默认), scale, bounce, micro-bounce, rotate, slide
ref=xxx
, 类似vue
的节点标识, 可方便的在mounted()
之后通过 this.$refs.xxx
来访问该节点bind()
方法来给当前组件绑定事件时, 组件移除时事件也会自动销毁,无需手动销毁。props
定义import { css, html, Component } from '//jscdn.ink/@bd/core/latest/index.js'
class Hello extends Component {
static props = {
count: {
type: Number,
default: 0,
attribute: true // 是否显式表现为html属性
},
foo: 0, // 简写
bar: String // 简写
}
// 若需要支持 scss, 则需要使用 @bd/wcui-cli,预处理。
// 可支持数组
static styles = css`
button { color: #09f; }
span { color: #f30; }
`
// 支持多个
static styles = [
css`...`,
css`...`
]
render(){
return html`
<div>
<button @click="${this.increase}">点击我</button>
</div>
<div>所有点击数为: <span>${this.count}</span></div>
`
}
increase(){
this.count++
}
}
if (!customElements.get('wc-hello')) {
customElements.define('wc-hello', Hello)
}
// 和上面的写法等价
// 如果不希望修改前缀`wc-`的话, 可以直接调用内置的reg方法注册组件即可。
Hello.reg('hello')
/*
<!-- 在html中,便可以直接使用 -->
<wc-hello></wc-hello>
*/
FAQs
百搭UI组件库的核心
We found that @bd/core demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.