mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
35 lines
981 B
JavaScript
35 lines
981 B
JavaScript
var marko_template = require("marko/html").t(__filename);
|
|
|
|
module.exports = marko_template;
|
|
|
|
var marko_widgets = require("marko/widgets"),
|
|
marko_registerWidget = marko_widgets.registerWidget,
|
|
marko_widgetType = marko_registerWidget("/marko-test$1.0.0/autotests/widgets-compilation/component-include-attr/index", function() {
|
|
return require("./");
|
|
}),
|
|
marko_helpers = require("marko/runtime/html/helpers"),
|
|
marko_loadTag = marko_helpers.t,
|
|
include_tag = marko_loadTag(require("marko/widgets/taglib/include-tag")),
|
|
marko_attr = marko_helpers.a;
|
|
|
|
function render(data, out, widget, state) {
|
|
out.w("<div" +
|
|
marko_attr("id", widget.id) +
|
|
"><h1>Header</h1><div" +
|
|
marko_attr("id", widget.elId(0)) +
|
|
">");
|
|
|
|
include_tag({
|
|
_target: widget.body,
|
|
_widgetId: widget.elId(0),
|
|
_arg: widget
|
|
}, out);
|
|
|
|
out.w("</div></div>");
|
|
}
|
|
|
|
marko_template._ = marko_widgets.r(render, {
|
|
type: marko_widgetType,
|
|
body: 0
|
|
});
|