Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
sibiraj-s committed Dec 10, 2023
1 parent 52c4bd3 commit aeb4d6b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Refer: https://www.tiptap.dev/api/extensions/bubble-menu

## SvelteNodeViewRenderer

This enables rendering Svelte Components as NodeViews.
SvelteNodeViewRenderer enables rendering Svelte Components as NodeViews. The following is an example for creating a counter component

### Create a Node Extension

Expand Down Expand Up @@ -141,17 +141,16 @@ export const SvelteCounterExtension = Node.create({
export let node: NodeViewProps['node'];
export let updateAttributes: NodeViewProps['updateAttributes'];
export let selected: NodeViewProps['selected'] = false;
const handleClick = () => {
updateAttributes({ count: node.attrs.count + 1 });
};
</script>
<NodeViewWrapper class={cx('svelte-component', { selected })}>
<span class="label">Svelte Component</span>
<NodeViewWrapper>
<span>Svelte Component</span>
<div class="content">
<div>
<button on:click={handleClick} type="button">
This button has been clicked {node.attrs.count} times.
</button>
Expand Down

0 comments on commit aeb4d6b

Please sign in to comment.