我有以下片段:
button('.textbutton', {
type: "button",
onclick: `toggleVisibility('#abs-${submission.submission_id}');`
},
'Abstract'
),
a( {href: "https://localhost:8080"}, 'View Article'),
div(`#abs-${submission.submission_id}`,
{style: 'display:none'}, submission.abstract
),
这似乎呈现为:
<button class="textbutton">Abstract</button>
<a>View Article</a>
<div id="abs-1405603">Text not shown on SO...</div>
请注意,没有呈现任何属性。我在这个文件中的 cycle.js 导入很简单:
import {VNode, div, a, button, h3, img, hr, b, p, span} from "@cycle/dom";