本文整理匯總了TypeScript中@storybook/addon-knobs/angular.text函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript text函數的具體用法?TypeScript text怎麽用?TypeScript text使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了text函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: text
.add('With knobs', () => {
const name = text('name', 'Dynamic knob');
return {
component: ServiceComponent,
props: {
name,
},
};
});
示例2: text
.add('With Knobs', () => ({
template: `<storybook-button-component [text]="text" (onClick)="onClick($event)"></storybook-button-component>`,
props: {
text: text('text', 'Button with custom styles'),
onClick: action('log'),
},
styles: [
`
storybook-button-component {
background-color: red;
padding: 25px;
}
`,
],
}));
示例3: text
.add('inputs and inject dependencies with knobs', () => ({
component: DiComponent,
props: {
title: text('title', 'Component dependencies'),
},
}));
示例4: text
.add('With Knobs', () => ({
component: NameComponent,
props: {
field: text('field', 'foobar'),
},
}));