mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-05 16:11:33 +08:00
32 lines
640 B
JavaScript
32 lines
640 B
JavaScript
import { document } from 'global';
|
|
import React from 'react';
|
|
import { withQuery } from '@storybook/addon-queryparams';
|
|
|
|
export default {
|
|
title: 'Addons|QueryParams',
|
|
decorators: [withQuery],
|
|
|
|
parameters: {
|
|
query: {
|
|
mock: true,
|
|
},
|
|
},
|
|
};
|
|
|
|
export const mockIsTrue = () => (
|
|
<div>This story should have an extra url query param: {document.location.search}</div>
|
|
);
|
|
|
|
mockIsTrue.story = {
|
|
name: 'mock is true',
|
|
};
|
|
|
|
export const mockIs4 = () => (
|
|
<div>This story should have an extra url query param: {document.location.search}</div>
|
|
);
|
|
|
|
mockIs4.story = {
|
|
name: 'mock is 4',
|
|
parameters: { query: { mock: 4 } },
|
|
};
|