LLWiki正在建设中,欢迎加入我们!
“模块:Arguments/doc”的版本间差异
跳转到导航
跳转到搜索
小 |
小 (→选项: // 使用Wikiplus小工具快速编辑) 标签:移动版网页编辑 移动版编辑 |
||
第5行: | 第5行: | ||
! 选项 !! 说明 |
! 选项 !! 说明 |
||
|- |
|- |
||
| trim || 去除参数的首 |
| trim || 去除参数的首尾空白字符,默认为<code lang="lua">true</code> |
||
|- |
|- |
||
| removeBlanks || 将空参数转换为<code lang="lua">nil</code>,默认为<code lang="lua">true</code> |
| removeBlanks || 将空参数转换为<code lang="lua">nil</code>,默认为<code lang="lua">true</code> |
2021年1月4日 (一) 21:23的最新版本
这个模块一般用于构建其他模块,常用语法为local getArgs = require('Module:Arguments').getArgs
,此时getArgs(frame)
会生成一个由模块参数组成的table。
选项
选项 | 说明 |
---|---|
trim | 去除参数的首尾空白字符,默认为true
|
removeBlanks | 将空参数转换为nil ,默认为true
|
valueFunc | 用于进一步处理输入参数的Lua函数 |
frameOnly | 只接受当前frame的参数,常见于带参数的{{#invoke:module|function|args}}
|
parentOnly | 只接受parent frame的参数,常见于不带参数的{{#invoke:module|function}}
|
parentFirst | 优先查找parent frame的参数,invoke可能带参数可能不带参数 |
wrappers | 只接受来自wrappers模板(或其沙盒版本,命名形式如Template:wrappers/sandbox)的参数或当前frame的参数 |
readOnly | 不可写入参数 |
noOverwrite | 不可改写已有参数 |
注释
如本模块不能满足某些特定需要,请自行书写处理输入参数的函数。
外部链接
本页面含有来自维基百科的文本,以CC BY-SA 3.0授权引入。经过双方的修改,内容可能已与来源有很大差异。