eslint
This commit is contained in:
parent
c91af1288b
commit
4992ec76fd
|
@ -4,7 +4,12 @@ import { tag, render, WeElement } from '../../src/omi'
|
|||
class HelloElement extends WeElement {
|
||||
render(props) {
|
||||
const { count, num } = props
|
||||
return [<div>Hello</div>, <div>Element</div>, <div>{count}</div>,<div>{num}</div>]
|
||||
return [
|
||||
<div>Hello</div>,
|
||||
<div>Element</div>,
|
||||
<div>{count}</div>,
|
||||
<div>{num}</div>
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12,18 +17,18 @@ class HelloElement extends WeElement {
|
|||
class MyApp extends WeElement {
|
||||
data = {
|
||||
count: 1,
|
||||
list:[0]
|
||||
list: [0]
|
||||
}
|
||||
render() {
|
||||
this.data.map((item,index) => {
|
||||
return <hello-element key={index} num={item}/>
|
||||
this.data.map((item, index) => {
|
||||
return <hello-element key={index} num={item} />
|
||||
})
|
||||
}
|
||||
|
||||
installed() {
|
||||
setTimeout(() => {
|
||||
this.data.count++;
|
||||
this.data.list.push(1);
|
||||
this.data.count++
|
||||
this.data.list.push(1)
|
||||
this.update()
|
||||
})
|
||||
}
|
||||
|
|
|
@ -36,12 +36,12 @@ export function diff(dom, vnode, context, mountAll, parent, componentRoot) {
|
|||
ret = []
|
||||
let parentNode = null
|
||||
if (isArray(dom)) {
|
||||
let domLength = dom.length;
|
||||
let vnodeLength = vnode.length;
|
||||
let maxLength = domLength >= vnodeLength ? domLength : vnodeLength;
|
||||
parentNode = dom[0].parentNode;
|
||||
for(let i = 0; i < maxLength ; i++){
|
||||
ret.push(idiff(dom[i],vnode[i],context,mountAll,componentRoot));
|
||||
let domLength = dom.length
|
||||
let vnodeLength = vnode.length
|
||||
let maxLength = domLength >= vnodeLength ? domLength : vnodeLength
|
||||
parentNode = dom[0].parentNode
|
||||
for (let i = 0; i < maxLength; i++) {
|
||||
ret.push(idiff(dom[i], vnode[i], context, mountAll, componentRoot))
|
||||
}
|
||||
} else {
|
||||
vnode.forEach(function(item) {
|
||||
|
|
Loading…
Reference in New Issue