@alicd/templateparser
Version:
walle template parser
43 lines (41 loc) • 1.18 kB
JavaScript
;
/**
* @license
* Copyright Alibaba Group and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
module.exports = {
templateQuerySelector: 'script[type=\'text/template\']',
// > 替换成的标识符
tagStartReplaceStr: '<',
// > 替换成的标识符
tagEndReplaceStr: '>',
// 判断标签是否是组件的正则表达式
componentsRegExp: /^[A-Z]/,
// 标示表达式的开始符
expressStartTag: '{',
// 标示表达式的结束符
expressEndTag: '}',
// 引用状态数据的标志
xbindState: /\$|(?:this\.state\.)/,
// java context 上下文标示
globalVarTag: 'ctx',
// 不能再表达式中出现的字符
checkFilter: ['var', 'function', 'eval', 'alert'],
// 指令属性标示
instruction: 'x-',
// for循环属性
loopAttrName: 'x-for',
// if属性名
ifAttrName: 'x-if',
// elseif 属性名
elseIfAttrName: 'x-elseif',
// else 属性
elseAttrName: 'x-else',
// 标签片段
blockTagName: 'x-block',
bindAttrName: 'x-bind',
spreadAttribute: /^\{\.\.\.(.+?)\}$/
};