From 6eacb13aff36508bed33adf400517e5556549eec Mon Sep 17 00:00:00 2001 From: Gauthier Roebroeck Date: Tue, 22 Jul 2025 17:35:34 +0800 Subject: [PATCH] refactor story --- .../components/FormattedMessage.stories.ts | 73 +++++++++++++++---- 1 file changed, 59 insertions(+), 14 deletions(-) diff --git a/next-ui/src/components/FormattedMessage.stories.ts b/next-ui/src/components/FormattedMessage.stories.ts index 517a8870..62267915 100644 --- a/next-ui/src/components/FormattedMessage.stories.ts +++ b/next-ui/src/components/FormattedMessage.stories.ts @@ -1,6 +1,6 @@ import type { Meta, StoryObj } from '@storybook/vue3-vite' -import FormattedMessage from './FormattedMessage.ts' +import FormattedMessage from './FormattedMessage' const meta = { component: FormattedMessage, @@ -8,22 +8,60 @@ const meta = { // More on how to position stories at: https://storybook.js.org/docs/configure/story-layout }, args: {}, -} satisfies Meta +} satisfies Meta export default meta type Story = StoryObj export const Default: Story = { + args: { + messageDescriptor: { + defaultMessage: 'Please accept terms and

conditions
first', + id: 'test', + }, + }, render: (args: object) => ({ components: { FormattedMessage }, setup() { return { args } }, template: ` - + + + + + + `, + }), +} +export const Values: Story = { + args: { + messageDescriptor: { + defaultMessage: + 'Please accept terms and

conditions
first, {name}', + id: 'test', + }, + values: { + name: 'John', + }, + }, + render: (args: object) => ({ + components: { FormattedMessage }, + setup() { + return { args } + }, + template: ` +