在这里,我得到一个值,我比较......但我需要得到数组值,然后处理 找到它
import { compile } from '../../src/index';
let customHelper: Object = {
upperCase: (str: string) => {
return str.toUpperCase();
}
};
let data: object = { value: 20 };
let getDOMString: (data: object) => HTMLCollection = compile(
'<div>' +
'${if(value >= 10)}' +
'<span> Value > Than 10 </span>' +
'${else if(value === 10)}' +
'<span> Value EqualTo 10 </span>' +
'${else}' +
'<span> Value < 10 </span>' +
'${/if}' +
'</div>',
customHelper);
let opElem: HTMLCollection = getDOMString(data);
document.getElementById('element').appendChild(opElem[0]);
需要获取值数组并进行比较