mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 02:47:50 +00:00
Doc tweaks. [ci skip]
This commit is contained in:
26
lodash.js
26
lodash.js
@@ -4237,7 +4237,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an object composed from arrays of property names and values. Provide
|
* Creates an object composed from arrays of property names and values. Provide
|
||||||
* either a single two dimensional array, i.e. `[[key1, value1], [key2, value2]]`
|
* either a single two dimensional array, e.g. `[[key1, value1], [key2, value2]]`
|
||||||
* or two arrays, one of property names and one of corresponding values.
|
* or two arrays, one of property names and one of corresponding values.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
@@ -7552,7 +7552,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a two dimensional array of a given object's key-value pairs,
|
* Creates a two dimensional array of a given object's key-value pairs,
|
||||||
* i.e. `[[key1, value1], [key2, value2]]`.
|
* e.g. `[[key1, value1], [key2, value2]]`.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
@@ -8070,7 +8070,7 @@
|
|||||||
* properties may be accessed as free variables in the template. If a setting
|
* properties may be accessed as free variables in the template. If a setting
|
||||||
* object is provided it overrides `_.templateSettings` for the template.
|
* object is provided it overrides `_.templateSettings` for the template.
|
||||||
*
|
*
|
||||||
* Note: In the development build, `_.template` utilizes sourceURLs for easier debugging.
|
* Note: In the development build `_.template` utilizes sourceURLs for easier debugging.
|
||||||
* See the [HTML5 Rocks article on sourcemaps](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
|
* See the [HTML5 Rocks article on sourcemaps](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
|
||||||
* for more details.
|
* for more details.
|
||||||
*
|
*
|
||||||
@@ -8109,26 +8109,26 @@
|
|||||||
* compiled({ 'people': ['fred', 'barney'] });
|
* compiled({ 'people': ['fred', 'barney'] });
|
||||||
* // => '<li>fred</li><li>barney</li>'
|
* // => '<li>fred</li><li>barney</li>'
|
||||||
*
|
*
|
||||||
* // using the ES6 delimiter as an alternative to the default "interpolate" delimiter
|
|
||||||
* var compiled = _.template('hello ${ name }');
|
|
||||||
* compiled({ 'name': 'pebbles' });
|
|
||||||
* // => 'hello pebbles'
|
|
||||||
*
|
|
||||||
* // using the internal `print` function in "evaluate" delimiters
|
* // using the internal `print` function in "evaluate" delimiters
|
||||||
* var compiled = _.template('<% print("hello " + name); %>!');
|
* var compiled = _.template('<% print("hello " + name); %>!');
|
||||||
* compiled({ 'name': 'barney' });
|
* compiled({ 'name': 'barney' });
|
||||||
* // => 'hello barney!'
|
* // => 'hello barney!'
|
||||||
*
|
*
|
||||||
* // using a custom template delimiters
|
* // using the ES6 delimiter as an alternative to the default "interpolate" delimiter
|
||||||
|
* var compiled = _.template('hello ${ name }');
|
||||||
|
* compiled({ 'name': 'pebbles' });
|
||||||
|
* // => 'hello pebbles'
|
||||||
|
*
|
||||||
|
* // using custom template delimiters
|
||||||
* _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
|
* _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
|
||||||
* var compiled = _.template('hello {{ name }}!');
|
* var compiled = _.template('hello {{ name }}!');
|
||||||
* compiled({ 'name': 'mustache' });
|
* compiled({ 'name': 'mustache' });
|
||||||
* // => 'hello mustache!'
|
* // => 'hello mustache!'
|
||||||
*
|
*
|
||||||
* // delimiters cannot be nested, even in strings
|
* // using backslashes to treat delimiters as plain text
|
||||||
* var compiled = _.template('<%- "<%- value %>" %>');
|
* var compiled = _.template('<%= "\\<%- value %\\>" %>');
|
||||||
* compiled({});
|
* compiled({ 'value': 'ignored' });
|
||||||
* // => throws error
|
* // => '<%- value %>'
|
||||||
*
|
*
|
||||||
* // using the `imports` option to import `jQuery` as `jq`
|
* // using the `imports` option to import `jQuery` as `jq`
|
||||||
* var text = '<% jq.each(people, function(name) { %><li><%- name %></li><% }); %>';
|
* var text = '<% jq.each(people, function(name) { %><li><%- name %></li><% }); %>';
|
||||||
|
|||||||
Reference in New Issue
Block a user