feat(code-snippet): add copy functionality

- docs: add custom feedback copy text example
This commit is contained in:
Eric Y Liu 2021-04-01 14:19:11 -07:00
commit 50b93c8a17
15 changed files with 91 additions and 94 deletions

View file

@ -11,6 +11,7 @@ export interface CodeSnippetProps {
/**
* Set the code snippet text
* Alternatively, use the default slot (e.g., <CodeSnippet>{`code`}</CodeSnippet>)
* You must use the `code` prop to copy the code
*/
code?: string;
@ -115,6 +116,7 @@ export default class CodeSnippet extends SvelteComponentTyped<
mouseenter: WindowEventMap["mouseenter"];
mouseleave: WindowEventMap["mouseleave"];
animationend: WindowEventMap["animationend"];
copy: CustomEvent<any>;
},
{ default: {} }
> {}