<content>
Positions the LIGHT_DOM
within a component’s view.
Deprecated 4.0
Use <can-slot> and <can-template> instead.
<content>DEFAULT_CONTENT</content>
When a user creates a new component in a view, the content between the tags is the
LIGHT_DOM
. For example, Hello <b>World</b>
is the LIGHT_DOM
in the following:
<my-tag>Hello <b>World</b></my-tag>
The <content>
tag can be used within my-tag
to position the LIGHT_DOM
. For
example, to position the LIGHT_DOM
within an <h1>
, <my-tag>
could be defined like:
import Component from "can-component";
Component.extend( {
tag: "my-tag",
view: "<h1><content/></h1>"
} );
Parameters
- DEFAULT_CONTENT
{sectionRenderer(context, helpers)}
:The content that should be used if there is no
LIGHT_DOM
passed to the component.The following, makes
my-tag
showHi There!
if noLIGHT_DOM
is passed:Component.extend( { tag: "my-tag", view: "<h1><content>Hi There!</content></h1>" } );