omip - fix nodeName
This commit is contained in:
parent
993b1f9140
commit
efed5c371a
Binary file not shown.
After Width: | Height: | Size: 8.7 KiB |
|
@ -1,7 +1,10 @@
|
|||
window.getApp = function () {
|
||||
return {
|
||||
globalData: {
|
||||
userInfo: null
|
||||
userInfo: {
|
||||
avatarUrl: 'https://github.com/Tencent/omi/raw/master/assets/omi-logo-140.png?sanitize=true',
|
||||
nickName: 'dntzhang(张磊)'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -65,6 +65,20 @@ var stack = [];
|
|||
|
||||
var EMPTY_CHILDREN = [];
|
||||
|
||||
//
|
||||
var mapTag = {
|
||||
'view': 'div',
|
||||
'picker': 'select',
|
||||
'image': 'img',
|
||||
'navigator': 'a',
|
||||
'text': 'span'
|
||||
}
|
||||
|
||||
var getNodeName = function(name){
|
||||
if(mapTag[name]) return mapTag[name]
|
||||
return name
|
||||
}
|
||||
|
||||
/**
|
||||
* JSX/hyperscript reviver.
|
||||
* @see http://jasonformat.com/wtf-is-jsx
|
||||
|
@ -131,7 +145,7 @@ function h(nodeName, attributes) {
|
|||
}
|
||||
|
||||
var p = new VNode();
|
||||
p.nodeName = nodeName;
|
||||
p.nodeName = getNodeName(nodeName);
|
||||
p.children = children;
|
||||
p.attributes = attributes == null ? undefined : attributes;
|
||||
p.key = attributes == null ? undefined : attributes.key;
|
||||
|
|
Loading…
Reference in New Issue