
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
storybook-addon-vue-slots
Advanced tools
Enables to use Vue slots inside Storybook's CSF files.
pnpm add -D storybook-addon-vue-slots
Add the storybook-addon-vue-slots
to your plugins in main.ts
file:
// .storybook/main.ts
export default {
// ...
addons: [
// ...
'storybook-addon-vue-slots',
],
} satisfies StorybookConfig
Run:
npm run storybook
To run an example Storybook
By default, the addon will pass the [slotName]
arg to the template, e.x. {{ args.default }}
.
Add a description to the slot by passing a string to the slot definition:
// MyComponent.stories.ts
export default meta = {
parameters: {
slots: {
default: `Default slot content`,
},
},
}
Use args.[slotName]
inside the template to pass data from Storybook controls to the slot, or access other args.
// MyComponent.stories.ts
export default meta = {
parameters: {
slots: {
default: {
description: 'Default slot',
template: `<p>{{ args.default }}</p>`,
},
header: {
description: 'Header slot',
template: `<p>{{ args.header }}</p>`,
},
},
},
}
So, value of header
arg control in Storybook table is being passed into the slot template, allowing control of an aspect of the slot.
// MyComponent.stories.ts
export default meta = {
parameters: {
slots: {
default: {
description: 'Default slot',
template: `<p>{{ args.default }}</p>`,
},
header: {
description: 'Header slot',
components: { AppButton },
template: `<AppButton>{{ args.header }}</AppButton>`,
},
},
},
}
Help support my open-source work through PayPal and GitHub Sponsors.
MIT License © 2023 Jacob Janisz
FAQs
Vue Slots support for Storybook
The npm package storybook-addon-vue-slots receives a total of 5,539 weekly downloads. As such, storybook-addon-vue-slots popularity was classified as popular.
We found that storybook-addon-vue-slots 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.