Skip to content

Commit

Permalink
Add html bindings to component test stories to test together with nor…
Browse files Browse the repository at this point in the history
…mal component props
  • Loading branch information
ThaNarie committed May 17, 2021
1 parent 81d4510 commit f549e9e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions examples/src/components/core/bind-map/BindMap.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ export const BindMapComponents: Story = () => {
...bindMap(refs.items, (ref) => ({
isActive: computed(() => activeValue.value === ref.component?.props.value),
onActivate: () => (activeValue.value = ref.component?.props.value ?? null),
event: {
mouseenter: () => console.log('mouse enter'),
},
})),
];
},
Expand Down
8 changes: 7 additions & 1 deletion examples/src/components/core/refs/RefComponent.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,13 @@ export const Default: Story = () => ({
},
setup({ refs }) {
return [
bind(refs.btnComponent, { label: computed(() => 'label1'), to: computed(() => 'to1') }),
bind(refs.btnComponent, {
label: computed(() => 'label1'),
to: computed(() => 'to1'),
event: {
click: () => console.log('clicked'),
},
}),
bind(refs.btnRef, { label: computed(() => 'label2'), to: computed(() => 'to2') }),
bind(refs.lnkComponent, { label: computed(() => 'label3'), href: computed(() => '#to3') }),
bind(refs.lnkRef, { label: computed(() => 'label4'), href: computed(() => '#to4') }),
Expand Down

0 comments on commit f549e9e

Please sign in to comment.