语法高亮,滚动条美化,设置页面调整

This commit is contained in:
fofolee
2019-04-19 02:41:09 +08:00
parent 1e8f76c000
commit 359d29ee0b
1590 changed files with 12328 additions and 11441 deletions

View File

@@ -5,7 +5,7 @@
<p class="hidden">The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone <a class="external" href="https://github.com/mdn/interactive-examples" rel="noopener">https://github.com/mdn/interactive-examples</a> and send us a pull request.</p>
<h2 id="语法">语法</h2>
<pre><code>new Intl.ListFormat([<var>locales</var>[, <var>options</var>]])
</code></pre>
</code></code></pre>
<h3 id="参数">参数</h3>
<dl>
<dt><code>locales</code></dt>
@@ -38,7 +38,7 @@
<h2 id="示例">示例</h2>
<h3 id="使用_format">使用 <code>format</code></h3>
<p>下面的例子展示了用英语语言怎么去创建一个列表格式化器。</p>
<pre class="brush: js">const list = ['Motorcycle', 'Bus', 'Car'];
<pre><code class="language-javascript">const list = ['Motorcycle', 'Bus', 'Car'];
console.log(new Intl.ListFormat('en-GB', { style: 'long', type: 'conjunction' }).format(list));
// &gt; Motorcycle, Bus and Car
@@ -48,14 +48,14 @@
console.log(new Intl.ListFormat('en-GB', { style: 'narrow', type: 'unit' }).format(list));
// &gt; Motorcycle Bus Car
</pre>
</code></pre>
<h3 id="使用_formatToParts">使用 <code>formatToParts</code></h3>
<p>下面的例子展示了如何创建一个返回被格式化部分的列表格式化器。</p>
<pre class="brush: js">const list = ['Motorcycle', 'Bus', 'Car'];
<pre><code class="language-javascript">const list = ['Motorcycle', 'Bus', 'Car'];
console.log(new Intl.ListFormat('en-GB', { style: 'long', type: 'conjunction' }).formatToParts(list));
// &gt; [ { "type": "element", "value": "Motorcycle" }, { "type": "literal", "value": ", " }, { "type": "element", "value": "Bus" }, { "type": "literal", "value": ", and " }, { "type": "element", "value": "Car" } ];
</pre>
</code></pre>
<h2 id="说明">说明</h2>
<table class="standard-table">
<tbody>