mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-28 05:10:17 +08:00
Add a Svelte Html component
This commit is contained in:
parent
1ea262fe54
commit
385f610f23
@ -1,6 +1,7 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
// eslint-disable-next-line react/no-danger
|
||||
export const Html = ({ contents }) => <div dangerouslySetInnerHTML={{ __html: contents }} />;
|
||||
|
||||
Html.propTypes = {
|
||||
|
8
code/renderers/svelte/template/components/Html.svelte
Normal file
8
code/renderers/svelte/template/components/Html.svelte
Normal file
@ -0,0 +1,8 @@
|
||||
<script>
|
||||
/**
|
||||
* contents
|
||||
*/
|
||||
export let contents = '';
|
||||
</script>
|
||||
|
||||
<div>{@html contents}></div>
|
@ -1,5 +1,6 @@
|
||||
import globalThis from 'global';
|
||||
|
||||
import Button from './Button.svelte';
|
||||
import Html from './Html.svelte';
|
||||
|
||||
globalThis.Components = { Button };
|
||||
globalThis.Components = { Button, Html };
|
||||
|
Loading…
x
Reference in New Issue
Block a user