0.2.8 • Published 5 years ago
@idli/idli-script-editor v0.2.8
Using this component
Script tag
- Put a script tag similar to this
<script src='https://unpkg.com/@idli/idli-script-editor@0.2.1/dist/idli-script-editor.js'></script>
in the head of your index.html - Then you can use the element anywhere in your template, JSX, html etc
Node Modules
- Run
npm install @idli/idli-script-editor --save
- Put a script tag similar to this
<script src='node_modules/@idli/idli-script-editor/dist/idli-script-editor.js'></script>
in the head of your index.html - Then you can use the element anywhere in your template, JSX, html etc
In a stencil-starter app
- Run
npm install @idli/idli-script-editor --save
- Add an import to the npm packages
import @idli/idli-script-editor;
- Then you can use the element anywhere in your template, JSX, html etc
Example:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Idli Script Editor</title>
<script src='https://unpkg.com/@idli/idli-script-editor@0.2.1/dist/idli-script-editor.js'></script>
</head>
<body>
<idli-script-editor id="editor" theme="dark"></idli-script-editor>
<script>
document.getElementById('editor').value = `function helloWorld(){
alert('Hello world!');
}`;
</script>
</body>
</html>