模板:Progression/sandbox
| File:Sandbox.svg | 这是Template:Progression(差异)的沙盒。 |
语法[编辑]
{{Progression|百分数}}百分数,取0至100间的数字,不带%。{{Progression|参数1|参数2}}- 利用
param1/param2自动计算完成度百分比。 {{Progression|参数1|参数2|task=参数3}}- 显示任务名称。
例子[编辑]
单参数[编辑]
{{Progression|0}} :
| 已完成0% | |
{{Progression|0.5}} :
| 已完成0.5% | ||
{{Progression|1}} :
| 已完成1% | ||
{{Progression|36.7}} :
| 已完成36.7% | ||
{{Progression|100}} :
| 已完成100% | |
双参数[编辑]
{{Progression|0|250}} :
| 已完成0% | |
{{Progression|100|250}} :
| 已完成40% | ||
{{Progression|200|300}} :
| 已完成66.7% | ||
{{Progression|300|300}} :
| 已完成100% | |
三参数[编辑]
{{Progression|0|250|task=整理文章}} :
| 整理文章: 已完成0% | |
{{Progression|100|250|task=整理文章}} :
| 整理文章: 已完成40% | ||
TemplateData[编辑]
<templatedata>{ "params": { "1": { "label": "值", "description": "进度的当前值。", "type": "number", "suggested": true }, "2": { "aliases": [ "total" ], "label": "最大值", "description": "进度条的最大值,即总共的值。", "type": "number", "default": "100" }, "width": { "label": "宽度", "description": "进度条的CSS宽度。", "example": "100px、30em", "type": "string" }, "task": { "description": "显示在数值前的名称。", "example": "整理文章", "type": "line", "label": "任务名称" }, "decimal": { "description": "小数取整到的位数。", "type": "number", "label": "小数" }, "hidecomplete": { "label": "隐藏完成", "description": "是否隐藏当前完成度的显示。", "type": "boolean", "default": "0" } }, "description": "此模板用于创建进度条。", "paramOrder": [ "1", "2", "width", "task", "decimal", "hidecomplete" ], "format": "inline" }</templatedata>