故事书 - 源代码不正确

问题描述

我正在将 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',};

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...