function initTemplate(temp){
var firstChild,
df = document.createDocumentFragment();
while(firstChild = temp.firstChild){
df.appendChild(firstChild);
};
compile(df)
}
function compile(df){
var firstChild,
children = df.childNodes,
len = children.length;
for(var k =0;k<len;k++){
if(isElementNode(children[k)){
compile(children[k])
}else{
compileTextNode(chilren[k])
}
}
function compileTextNode(tNode){
if(!tNode.expr){
tNode.expr = tNode.textContent;
}
tNode.textContent.replace(reg,function(node,key){
return getVal(vm,key)
})
}
function getVal(vm,key){
var arrs = key.replace(/\s+/,'').split(".");
arrs.reduce((prev,cur)=>{
return prev[cur]
},vm)
}