
Security News
pnpm 10.16 Adds New Setting for Delayed Dependency Updates
pnpm's new minimumReleaseAge setting delays package updates to prevent supply chain attacks, with other tools like Taze and NCU following suit.
@scalar/draggable
Advanced tools
npm install @scalar/draggable
A complete example can be found the playground, but basically you need a data structure like:
const sidebar = ref({
// Master list of all items
items: {
'1': {
id: '1',
name: 'Rangers',
children: ['2', '4', '5', '6', '7'],
},
'2': {
id: '2',
name: 'Stars',
children: ['3'],
},
'3': { id: '3', name: 'Bruins', children: [] },
'4': { id: '4', name: 'Canucks', children: [] },
'5': { id: '5', name: 'Panthers', children: [] },
'6': { id: '6', name: 'Avalanche', children: [] },
'7': { id: '7', name: 'Hurricanes', children: [] },
'8': { id: '8', name: 'Jets', children: [] },
'9': { id: '9', name: 'Oilers', children: [] },
'10': { id: '10', name: 'Predators', children: [] },
'11': { id: '11', name: 'Maple Leafs', children: [] },
'12': { id: '12', name: 'Kings', children: [] },
} satisfies Items,
// Root level children (the top level of the sidebar)
children: ['1', '8', '9', '10', '11', '12'],
})
Then you will need a recursive component that wraps Draggable like:
<template>
<Draggable
:id="id"
:ceiling="0.8"
:floor="0.2"
:height="30"
:parentIds="[...parentIds, id]">
<div
class="sidebar-item"
:class="{ 'sidebar-folder': items[id].children.length }">
{{ items[id].name }}
<SidebarItem
v-for="childId in items[id].children"
:id="childId"
:key="childId"
:items="items"
:parentIds="[...parentIds, id]" />
</div>
</Draggable>
</template>
Then manage the data manipluation on drop using the emitted events!
You can find an example in this repo under the playground
FAQs
A simple vue wrapper around html drag and drop
The npm package @scalar/draggable receives a total of 32,088 weekly downloads. As such, @scalar/draggable popularity was classified as popular.
We found that @scalar/draggable demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 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.
Security News
pnpm's new minimumReleaseAge setting delays package updates to prevent supply chain attacks, with other tools like Taze and NCU following suit.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.