docs: fix path regex (#11650)

This commit is contained in:
Tony
2023-01-19 10:41:50 -04:00
committed by GitHub
parent 44305f529b
commit 95dba06d1d

View File

@@ -19,11 +19,11 @@
<p class="path"> <p class="path">
路由: <code>{{ path }}</code> 路由: <code>{{ path }}</code>
</p> </p>
<div v-if="path.match(/:.*?(\/|$)/g)"> <div v-if="path.match(/(?<=:).*?(?=\/|$)/g)">
<p> <p>
参数: 参数:
</p> </p>
<ul><li class="params" v-for="(item, index) in path.match(/:.*?(\/|$)/g)"><code>{{item.replace(/:|\?|\+|\*|\//g,'')}}</code>, {{{'?':'可选','*':'零个或多个','+':'单个或多个'}[item[item.length-1]]||'必选'}} - <span v-html="renderMarkdown(paramsDesc[index])"></span></li></ul> <ul><li class="params" v-for="(item, index) in path.match(/(?<=:).*?(?=\/|$)/g)"><code>{{item.replace(/:|\?|\+|\*/g,'')}}</code>, {{{'?':'可选','*':'零个或多个','+':'单个或多个'}[item[item.length-1]]||'必选'}} - <span v-html="renderMarkdown(paramsDesc[index])"></span></li></ul>
</div> </div>
<div v-else><p>参数: </p></div> <div v-else><p>参数: </p></div>
<slot></slot> <slot></slot>