
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.
swipeable-cell
Advanced tools
A vue component which imitates iOS uitableviewcell and uicollectionviewcell swipe style
A vue component which imitates iOS UITableViewCell
and UICollectionViewCell
swipe style
it's so pretty easy to use, and it supports for:
default style
more actions
text only
image only
horizontal
note: all of these styles support to swiping right to delete function.
npm package
npm install swipeable-cell -S
the easiest way use is wrapping you cell content
import it in your component header.
improt SwipeableCell from 'swipeable-cell'
register into components
object and add it in template like this
<swipeable-cell v-for="(item, index) in dataList",
:key="index",
:data-index="index",
:options="options",
@swipeable-cell-actions="actionsHandler">
// ... your cell container dom node
</swipeable-cell>
action buttons will give you a callback when user tapped, in your component's methods
export default {
...
methods: {
// index: you just tapped cell
actionsHandler(o) {
// cellIndex: which is cell index in your dataList
// actionIndex: which is tapped action button's index if you have more,
// and if only one the index is 0
const { cellIndex, actionIndex } = o
this.dataList.splice(cellIndex, 1)
}
}
}
also support more style customized
you can return a options
object in your data()
object like bellow
data() {
return {
...
options: {
// specify this action button's width, optional
width: 90,
// specify action contents direction, optional
direction: 'horizontal',
// specify how many buttons would cell have, optional
// note: if you didn't pass this array, cell will provide a delete button as default
actions: [
{
text: 'more',
image: require('../xxx/xxx.png'),
backgroundColor: '#c7c6cb',
},
{
text: 'flag',
image: require('../xxx/xx.gif'),
backgroundColor: '#fd9502',
},
{
text: 'delete',
image: require('../xx/xxx.jpg'),
backgroundColor: '#fd3d30',
}
]
},
}
}
props
prop of data-index
is required. so you must pass it value when you loop for cell
property | description | Type | required |
---|---|---|---|
data-index | index of every cell | Number | Yes |
some configurable value in options
object:
property | description | Type | default |
---|---|---|---|
width | action button's width | Number | 80 |
direction | action button's content direction: horizontal or vertical | String | vertical |
actions | number of action buttons in every single cell | Array | - |
for every action style you can pass
property | description | Type | default |
---|---|---|---|
text | the action button's title | String | delete |
image | the action button's image icon | String | - |
backgroundColor | the action button's backgroundColor | String | '#fd3d30' |
only image actions data like
...
actions: [
{
image: require('your local image path here'),
backgroundColor: '#c7c6cb',
},
...
]
only text actions data like
...
actions: [
{
text: 'some text here',
backgroundColor: '#c7c6cb',
},
...
]
event
event name | description |
---|---|
swipeable-cell-actions | when cell's action buttons were tapped, this will give you a object that contains current tapped index in your data list and current action button's index that you tapped. so you can make your own logic in your component's methods |
for more usage examples please see demo project.
warmly welcome your PR and issues. ❤️
FAQs
A vue component which imitates iOS uitableviewcell and uicollectionviewcell swipe style
The npm package swipeable-cell receives a total of 11 weekly downloads. As such, swipeable-cell popularity was classified as not popular.
We found that swipeable-cell 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.