0

我正在将 storybook js 用于 vueJS UI 组件。在文档部分,源代码不正确。这是我在源代码中看到的:

<template>
      <aaa-button
         type="button"
         size="medium"
         variant="primary"
         icon=""
         title=""
         :default="null"
         text="Button"
      >
    Button
     </aaa-button>
</template>

问题:

  1. 为什么源代码进来<template>
  2. 为什么:default="null"来了。我没有控制该名称的任何道具。

这是.stories.js:

import AaaButton from '../../controls/button/button.vue';

export default {
  title: 'Controls/Form/Button',
  component: AaaButton,
  argTypes: {
    variant: { control: {type: 'select', options: ['primary', 'secondary', 'info', 'link']} },
    size: { control: { type: 'select', options: ['small', 'medium', 'large'] } },
    type: { control: { type: 'select', options: ['button', 'submit'] } }
  }
};

const Template = (args, { argTypes }) => ({
  props: Object.keys(argTypes),
  components: { AsiButton },
  template: '<aaa-button @onClick="onClick" v-bind="$props">{{text}}</aaa-button>',
});

export const Primary = Template.bind({});
Primary.args = {
  text: 'Button',
};
4

0 回答 0