模板:Codepen:修订间差异
来自康健生活
无编辑摘要 |
无编辑摘要 |
||
| 第10行: | 第10行: | ||
|{{#tag:html| | |{{#tag:html| | ||
{{#tag:html|{{#tag:script|function {{{id|}}}(_){ | {{#tag:html|{{#tag:script|function {{{id|}}}(_){ | ||
_.contentWindow.document.body.innerHTML = `{{#if:{{{html|}}}|{{{html|}}}|}} | _.contentWindow.document.body.innerHTML = `{{#if:{{{html|}}}| | ||
{{{html|}}}|}} | |||
{{#if:{{{style|}}}| | |||
{{#tag:style|{{{style|}}}|type=text\/css}}|}} | |||
{{#if:{{{script|}}}| | |||
{{#tag:script|{{{script|}}}|type=text\/javascript}}|}}`; | |||
}|type=text\/javascript}}}} | }|type=text\/javascript}}}} | ||
<iframe class="wiki-codepen-iframe" onload="{{{id|}}}()"></iframe> | <iframe class="wiki-codepen-iframe" onload="{{{id|}}}()"></iframe> | ||
|class=wiki-codepen-preview}} | |class=wiki-codepen-preview}} | ||
}}</div></includeonly> | }}</div></includeonly> | ||
2025年4月30日 (三) 10:30的版本
这个文档嵌入自模板:Codepen/doc
。
Usage
设置高度大于100,小于500
{{codepen
|id=uuid
|height=400
|html=<div></div>
|style=div {
display: block;
}
|script=var a=1;
}}