MCPcopy Index your code
hub / github.com/keepfool/vue-tutorials / tokensToExp

Function tokensToExp

06.Router/basic/js/vue.js:849–857  ·  view source on GitHub ↗

* Format a list of tokens into an expression. * e.g. tokens parsed from 'a {{b}} c' can be serialized * into one single expression as '"a " + b + " c"'. * * @param {Array} tokens * @param {Vue} [vm] * @return {String}

(tokens, vm)

Source from the content-addressed store, hash-verified

847 */
848
849 function tokensToExp(tokens, vm) {
850 if (tokens.length > 1) {
851 return tokens.map(function (token) {
852 return formatToken(token, vm);
853 }).join('+');
854 } else {
855 return formatToken(tokens[0], vm, true);
856 }
857 }
858
859 /**
860 * Format a single token.

Callers 3

vue.jsFile · 0.70
compileElementFunction · 0.70
compileDirectivesFunction · 0.70

Calls 1

formatTokenFunction · 0.70

Tested by

no test coverage detected