Skip to content

Commit

Permalink
docs(composables): fix example for signal based components
Browse files Browse the repository at this point in the history
  • Loading branch information
homj committed Nov 18, 2023
1 parent 899de30 commit 34bcf4f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions libs/composables/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,17 @@ import { bindAttribute } from './attribute.composable';
})
export class ButtonComponent {

readonly disabled = input(false);
readonly loading = input(false);
readonly appearance = input('solid');
readonly color = input(undefined);
readonly type = useAttribute('type', { defaultValue: 'button' });
readonly disabled = bindBooleanAttribute('disabled', input(false, { alias: 'disabled' }));
readonly loading = bindModifier('is-loading', input(false, { alias: 'loading' }), { initialValue: false });
readonly appearance = bindModifierGroup(input('solid', { alias: 'appearance'}));
readonly color = bindModifierGroup(undefined, input({ alias: 'color'}), { prefix: 'color' });

constructor() {
bindBooleanAttribute('disabled', this.disabled);
bindModifier('is-loading', this.loading);
bindModifierGroup(this.appearance);
bindModifierGroup(this.color, { prefix: 'color' });
bindAttribute('tabindex', computed(() => this.disabled() ? '-1' : '0'));
}
}
Expand Down

0 comments on commit 34bcf4f

Please sign in to comment.