Reverting erroneous docs formatting
This commit is contained in:
parent
f9e51636d8
commit
cea8e64359
1 changed files with 15 additions and 1 deletions
|
|
@ -267,7 +267,7 @@ m.mount(document.body, {
|
|||
|
||||
## Component arguments
|
||||
|
||||
Attributes passed to a component in v2.x must take the form of an object - simple values like `String`/`Number`/`Boolean` will be treated as children. Attributes are accessed within the component by reading them from the `vnode.attrs` object.
|
||||
Arguments to a component in v2.x must be an object, simple values like `String`/`Number`/`Boolean` will be treated as text children. Arguments are accessed within the component by reading them from the `vnode.attrs` object.
|
||||
|
||||
### v0.2.x
|
||||
|
||||
|
|
@ -381,6 +381,20 @@ m("div", "value", ["nested"])
|
|||
}
|
||||
```
|
||||
|
||||
If only a single text child is present on a DOM vnode, it instead sets `text` to that value.
|
||||
|
||||
```javascript
|
||||
m("div", "value")
|
||||
|
||||
// Becomes roughly:
|
||||
{
|
||||
tag: "div",
|
||||
attrs: null,
|
||||
text: "",
|
||||
children: undefined,
|
||||
}
|
||||
```
|
||||
|
||||
See [the vnode docs](vnodes.md) for more details on the v2.x vnode structure and how things are normalized.
|
||||
|
||||
*Most of the v2.x vnode properties here are omitted for brevity.*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue