
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.
@aidol/utils
Advanced tools
vue
实用指令集合。
@aidol/utils 2.x
已发布,可按该 迁移指南 进行迁移。
# yarn
$ yarn add @aidol/utils
# npm
$ npm i @aidol/utils
构建文件在 dist
文件夹下分为两个版本。
dist/aidol-utils.es.js
为 es Modules
版本。
dist/aidol-utils.umd.js
为 umd
版本,适合使用 <script></script>
标签的方式引用。
v-drag
, v-affix
, v-autoheight
等。该模块包含了一些 vue directive
。
安装指令的方式:
// main.js
import Vue from 'vue'
import { vueDirectives } from '@aidol/utils'
// 安装全部指令
for (const k in vueDirectives) {
if (vueDirectives.hasOwnProperty(k)) {
Vue.directive(k, vueDirectives[k])
}
}
// or 仅安装某个指令
Vue.directive('drag', vueDirectives.drag)
// ...
// new Vue({
// el: 'app'
// })
import { vueDirectives } from '@aidol/utils'
export default {
name: 'SomeComp',
directives: {
drag: vueDirectives.drag,
affix: vueDirectives.affix,
autoheight: vueDirectives.autoheight,
// ...
},
}
拖拽指令。当给某 dom 元素加上 v-drag
指令后,该元素会变成可拖拽状态。
<template>
<div class="some class" v-drag="draggable">this is a box.</div>
</template>
export default {
data() {
return {
draggable: true,
}
},
}
参数 | 类型 | 默认值 | 描述 |
---|---|---|---|
draggable | boolean | true | 控制是否可拖拽。 |
吸顶指令。可使用该指令实现元素吸顶效果。
<template>
<div class="some-container">
<div class="some-class" v-affix>this is a affix element.</div>
<div class="next-element"></div>
</div>
</template>
暂无。
自动设置高度。有时,我们希望当前页面不出现滚动条,或者某个包裹元素不会产生滚动条。那么,你可能会需要该指令,使得应用该指令的元素可以正好占满剩余视窗高度,从而不出现纵向滚动条。
<template>
<div class="some-container">
<div class="some-class">this is a top element.</div>
<div class="next-element" v-autoheight="bottomGap"></div>
</div>
</template>
export default {
data() {
return {
bottomGap: 20,
}
},
}
参数 | 类型 | 默认值 | 描述 |
---|---|---|---|
bottomGap | number | 20 | 预设距离底部的高度值。 |
FAQs
a javascript tool
The npm package @aidol/utils receives a total of 3 weekly downloads. As such, @aidol/utils popularity was classified as not popular.
We found that @aidol/utils 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.
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.