import { StoryFn, Meta } from '@storybook/vue3' import { ref } from 'vue' import VueSlider from '../../../lib' export default { title: 'Events/@error', parameters: { docs: { description: { component: ` - **Type**: \`(type, message) => void\` - **Arguments** - \`{ERROR_TYPE} type\` Error type - \`{string} message\` Error message \`\`\`ts enum ERROR_TYPE { VALUE = 1, // Value is illegal INTERVAL = 2, // \`interval\` cannot be divisible by \`(max - min)\` MIN, // Value is less than min MAX, // Value is greater than max ORDER, // When \`order\` is false, \`minRange/maxRange/enableCross/fixed\` is still set } \`\`\` - **Usage**: Event triggered when an error occurs in a component `, }, }, }, } as Meta export const error: StoryFn = args => ({ components: { VueSlider }, setup() { const value = ref(50) const errorType = ref(null) const errorMessage = ref(null) const interval = ref(1) const reset = () => { errorType.value = null errorMessage.value = null value.value = 50 interval.value = 1 } return { value, interval, errorType, errorMessage, reset } }, template: `

errorType={{ errorType }}

errorMessage={{ errorMessage }}

`, }) error.storyName = '@error'