Skip to content

Commit

Permalink
fix: update typo
Browse files Browse the repository at this point in the history
  • Loading branch information
PengYYYYY committed May 5, 2022
1 parent 3517256 commit b4e7e8e
Show file tree
Hide file tree
Showing 11 changed files with 86 additions and 42 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/typos-config.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
[default.extend-identifiers]
# *sigh* this just isn't worth the cost of fixing
actived = "actived"

[default.extend-words]
# Don't correct the surname "Teh"
actived = "actived"
formated = "formated"
formate = "formate"
Colum = "Colum"
ba = "ba"
10 changes: 5 additions & 5 deletions site/src/components/base-usage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
justifyContent: 'center',
}"
>
<slot :name="item.value" :configProps="{ ...defaultProps, ...changedProps }"></slot>
<slot :name="item.value" :config-props="{ ...defaultProps, ...changedProps }"></slot>
</div>
</td-doc-usage>
</template>
Expand Down Expand Up @@ -73,12 +73,12 @@ const defaultProps = ref(
);
const usageCode = computed(() => {
const propsStrs = Object.keys(changedProps.value)
const propsStr = Object.keys(changedProps.value)
.map((name) => `${stringifyProp(name, changedProps.value[name])}`)
.filter(Boolean);
const tureCode = props.code.replace(/\s*v-bind="configProps"/g, () =>
propsStrs.length ? `\n ${propsStrs.join('\n ')}` : '',
const trueCode = props.code.replace(/\s*v-bind="configProps"/g, () =>
propsStr.length ? `\n ${propsStr.join('\n ')}` : '',
);
return tureCode;
return trueCode;
});
</script>
2 changes: 1 addition & 1 deletion src/grid/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export function parseFlex(flex: TdColProps['flex']): string {
if (typeof flex === 'number') {
return `${flex} ${flex} 0`;
}
// 判断fle是否
// 判断是否是flex
if (/^\d+(\.\d+)?(px|r?em|%)$/.test(flex)) {
return `0 0 ${flex}`;
}
Expand Down
37 changes: 23 additions & 14 deletions test/ssr/__snapshots__/ssr.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2355,7 +2355,7 @@ exports[`ssr snapshot test renders ./examples/calendar/demos/card-cell.vue corre
<td class="t-calendar__table-body-cell t-is-checked t-calendar__table-body-cell--now">
<!--[-->
<div class="demo-cell">
<div class="cellAppend belongCurrent actived">28</div>
<div class="cellAppend belongCurrent activated">28</div>
</div>
<!--]-->
</td>
Expand Down Expand Up @@ -2620,7 +2620,7 @@ exports[`ssr snapshot test renders ./examples/calendar/demos/cell.vue correctly
<div class="slotWarper">
<!--[-->
<div class="item"><span class="error"></span> 错误事件</div>
<div class="item"><span class="waring"></span> 警告事件</div>
<div class="item"><span class="warning"></span> 警告事件</div>
<div class="item"><span class="success"></span> 正常事件</div>
<!--]-->
</div>
Expand Down Expand Up @@ -3349,10 +3349,10 @@ exports[`ssr snapshot test renders ./examples/calendar/demos/controller-config.v
<div class="t-calendar__control-section-cell">
<div class="t-select__wrap" modelvalue="2020">
<!--[-->
<div class="t-select t-select-polyfill t-size-m t-select__popup-reference">
<div class="t-select t-select-polyfill t-size-s t-select__popup-reference">
<!---->
<!---->
<!----><span class="t-tag t-tag--default t-tag--dark t-size-m" style="display:none;"><!----><!--[-->+0<!--]--><!----></span><span title="2020" class="t-select__single">2020</span>
<!----><span class="t-tag t-tag--default t-tag--dark t-size-s" style="display:none;"><!----><!--[-->+0<!--]--><!----></span><span title="2020" class="t-select__single">2020</span>
<!----><svg class="t-fake-arrow t-select__right-icon t-select__right-icon-polyfill" width="16" height="16" viewbox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" style="">
<path d="M3.75 5.7998L7.99274 10.0425L12.2361 5.79921" stroke="black" stroke-opacity="0.9" stroke-width="1.3"></path>
</svg>
Expand All @@ -3366,10 +3366,10 @@ exports[`ssr snapshot test renders ./examples/calendar/demos/controller-config.v
<div class="t-calendar__control-section-cell">
<div class="t-select__wrap" modelvalue="12">
<!--[-->
<div class="t-select t-select-polyfill t-size-m t-select__popup-reference">
<div class="t-select t-select-polyfill t-size-s t-select__popup-reference">
<!---->
<!---->
<!----><span class="t-tag t-tag--default t-tag--dark t-size-m" style="display:none;"><!----><!--[-->+0<!--]--><!----></span><span title="12" class="t-select__single">12</span>
<!----><span class="t-tag t-tag--default t-tag--dark t-size-s" style="display:none;"><!----><!--[-->+0<!--]--><!----></span><span title="12" class="t-select__single">12</span>
<!----><svg class="t-fake-arrow t-select__right-icon t-select__right-icon-polyfill" width="16" height="16" viewbox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" style="">
<path d="M3.75 5.7998L7.99274 10.0425L12.2361 5.79921" stroke="black" stroke-opacity="0.9" stroke-width="1.3"></path>
</svg>
Expand Down Expand Up @@ -6373,7 +6373,7 @@ exports[`ssr snapshot test renders ./examples/calendar/demos/slot-props-api.vue
</td>
<td class="t-calendar__table-body-cell">
<div class="calendar-slot-props-api-demo"><span><div class="calendar-slot-props-api-demo-slot-warrper"><!--[--><div class="item"><span class="error"></span>错误事件</div>
<div class="item"><span class="waring"></span>警告事件</div>
<div class="item"><span class="warning"></span>警告事件</div>
<div class="item"><span class="success"></span>正常事件</div>
<!--]-->
</div>
Expand Down Expand Up @@ -13098,7 +13098,7 @@ exports[`ssr snapshot test renders ./examples/dialog/demos/custom.vue correctly
<div class="t-dialog__header">
<!---->提示
</div><span class="t-dialog__close"><svg fill="none" viewbox="0 0 16 16" width="1em" height="1em" class="t-icon t-icon-close" style=""><path fill="currentColor" d="M8 8.92L11.08 12l.92-.92L8.92 8 12 4.92 11.08 4 8 7.08 4.92 4 4 4.92 7.08 8 4 11.08l.92.92L8 8.92z" fill-opacity="0.9"></path></svg></span>
<div class="t-dialog__body">自定义底部按钮,传入 ButttonProps</div>
<div class="t-dialog__body">自定义底部按钮,传入 ButtonProps</div>
<div class="t-dialog__footer">
<div><button class="t-button t-size-m t-button--variant-outline t-button--theme-default" type="button"><span class="t-button__text">我知道了</span></button><button class="t-button t-size-m t-button--variant-base t-button--theme-primary t-dialog__confirm" type="button"><span class="t-button__text">前往购物车</span></button></div>
</div>
Expand Down Expand Up @@ -13556,7 +13556,7 @@ exports[`ssr snapshot test renders ./examples/drawer/demos/custom.vue correctly
<!--]-->
</div>
<div class="t-drawer__footer">
<div><button class="t-button t-size-m t-button--variant-base t-button--theme-primary" type="button"><span class="t-button__text"><!--[-->confrim<!--]--></span></button><button class="t-button t-size-m t-button--variant-outline t-button--theme-default" type="button"><span class="t-button__text"><!--[-->cancel<!--]--></span></button></div>
<div><button class="t-button t-size-m t-button--variant-base t-button--theme-primary" type="button"><span class="t-button__text"><!--[-->confirm<!--]--></span></button><button class="t-button t-size-m t-button--variant-outline t-button--theme-default" type="button"><span class="t-button__text"><!--[-->cancel<!--]--></span></button></div>
</div>
</div>
</div><!-- 单独定义确认/取消按钮 -->
Expand Down Expand Up @@ -28851,6 +28851,7 @@ exports[`ssr snapshot test renders ./examples/table/demos/fixed-column.vue corre
<col style="width:100px;">
<col style="width:150px;">
<col style="width:150px;">
<col style="width:250px;">
<col style="width:100px;">
<col style="width:150px;">
<col style="width:100px;">
Expand All @@ -28873,6 +28874,9 @@ exports[`ssr snapshot test renders ./examples/table/demos/fixed-column.vue corre
<th data-colkey="default" class="t-table__th-default" style="">
<div class="t-table__th-cell-inner">默认值</div>
</th>
<th data-colkey="detail.position" class="t-table__th-detail.position" style="">
<div class="t-table__th-cell-inner">详情信息</div>
</th>
<th data-colkey="description" class="t-table__th-description" style="">
<div class="t-table__th-cell-inner">说明</div>
</th>
Expand Down Expand Up @@ -28904,6 +28908,7 @@ exports[`ssr snapshot test renders ./examples/table/demos/fixed-column.vue corre
<td class="" style="">共有</td>
<td class="" style="">String</td>
<td class="" style="">-</td>
<td class="" style="">读取 0 个数据的嵌套信息值</td>
<td class="" style="">数据源</td>
<td class="" style="">是</td>
<td class="" style="">
Expand All @@ -28924,6 +28929,7 @@ exports[`ssr snapshot test renders ./examples/table/demos/fixed-column.vue corre
<td class="" style="">私有</td>
<td class="" style="">Number</td>
<td class="" style="">0</td>
<td class="" style="">读取 1 个数据的嵌套信息值</td>
<td class="" style="">数据源</td>
<td class="" style="">否</td>
<td class="" style="">
Expand All @@ -28944,6 +28950,7 @@ exports[`ssr snapshot test renders ./examples/table/demos/fixed-column.vue corre
<td class="" style="">共有</td>
<td class="" style="">Array</td>
<td class="" style="">[]</td>
<td class="" style="">读取 2 个数据的嵌套信息值</td>
<td class="" style="">数据源</td>
<td class="" style="">否</td>
<td class="" style="">
Expand All @@ -28964,6 +28971,7 @@ exports[`ssr snapshot test renders ./examples/table/demos/fixed-column.vue corre
<td class="" style="">私有</td>
<td class="" style="">Object</td>
<td class="" style="">{}</td>
<td class="" style="">读取 3 个数据的嵌套信息值</td>
<td class="" style="">数据源</td>
<td class="" style="">否</td>
<td class="" style="">
Expand All @@ -28984,6 +28992,7 @@ exports[`ssr snapshot test renders ./examples/table/demos/fixed-column.vue corre
<td class="" style="">共有</td>
<td class="" style="">String</td>
<td class="" style="">-</td>
<td class="" style="">读取 4 个数据的嵌套信息值</td>
<td class="" style="">数据源</td>
<td class="" style="">是</td>
<td class="" style="">
Expand Down Expand Up @@ -37574,12 +37583,12 @@ exports[`ssr snapshot test renders ./examples/tabs/demos/base.vue correctly 1`]
<!--[-->
<div class="t-tab-panel">
<!--[-->
<p style="padding:25px;">选项卡1的内容,使用 t-tab-pannel 渲染</p>
<p style="padding:25px;">选项卡1的内容,使用 t-tab-panel 渲染</p>
<!--]-->
</div>
<div class="t-tab-panel" style="display:none;">
<!--[-->
<p style="padding:25px;">选项卡2的内容,使用 t-tab-pannel 渲染</p>
<p style="padding:25px;">选项卡2的内容,使用 t-tab-panel 渲染</p>
<!--]-->
</div>
<!---->
Expand Down Expand Up @@ -40376,7 +40385,7 @@ exports[`ssr snapshot test renders ./examples/tree/demos/controlled.vue correctl
<!---->
</div>
</div>
<div class="t-addon t-addon--prepend"><span class="t-addon__prepend">actived:</span>
<div class="t-addon t-addon--prepend"><span class="t-addon__prepend">activated:</span>
<div class="t-input__wrap">
<div class="t-input">
<!---->
Expand Down Expand Up @@ -41606,7 +41615,7 @@ exports[`ssr snapshot test renders ./examples/tree/demos/sync.vue correctly 1`]
<!---->
</div>
</div>
<div class="t-addon t-addon--prepend"><span class="t-addon__prepend">actived:</span>
<div class="t-addon t-addon--prepend"><span class="t-addon__prepend">activated:</span>
<div class="t-input__wrap">
<div class="t-input">
<!---->
Expand Down Expand Up @@ -41692,7 +41701,7 @@ exports[`ssr snapshot test renders ./examples/tree/demos/vmodel.vue correctly 1`
<!---->
</div>
</div>
<div class="t-addon t-addon--prepend"><span class="t-addon__prepend">actived:</span>
<div class="t-addon t-addon--prepend"><span class="t-addon__prepend">activated:</span>
<div class="t-input__wrap">
<div class="t-input">
<!---->
Expand Down
14 changes: 7 additions & 7 deletions test/unit/calendar/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1647,7 +1647,7 @@ exports[`Calendar Calendar cardCellVue demo works fine 1`] = `
class="demo-cell"
>
<div
class="cellAppend belongCurrent actived"
class="cellAppend belongCurrent activated"
>
28
</div>
Expand Down Expand Up @@ -4221,7 +4221,7 @@ exports[`Calendar Calendar cellVue demo works fine 1`] = `
class="item"
>
<span
class="waring"
class="warning"
/>
警告事件
</div>
Expand Down Expand Up @@ -4860,13 +4860,13 @@ exports[`Calendar Calendar controllerConfigVue demo works fine 1`] = `
>
<div
class="t-select t-select-polyfill t-size-m t-select__popup-reference"
class="t-select t-select-polyfill t-size-s t-select__popup-reference"
>
<!---->
<!---->
<!---->
<span
class="t-tag t-tag--default t-tag--dark t-size-m"
class="t-tag t-tag--default t-tag--dark t-size-s"
style="display: none;"
>
<!---->
Expand Down Expand Up @@ -4913,13 +4913,13 @@ exports[`Calendar Calendar controllerConfigVue demo works fine 1`] = `
>
<div
class="t-select t-select-polyfill t-size-m t-select__popup-reference"
class="t-select t-select-polyfill t-size-s t-select__popup-reference"
>
<!---->
<!---->
<!---->
<span
class="t-tag t-tag--default t-tag--dark t-size-m"
class="t-tag t-tag--default t-tag--dark t-size-s"
style="display: none;"
>
<!---->
Expand Down Expand Up @@ -12042,7 +12042,7 @@ exports[`Calendar Calendar slotPropsApiVue demo works fine 1`] = `
class="item"
>
<span
class="waring"
class="warning"
/>
警告事件
</div>
Expand Down
2 changes: 1 addition & 1 deletion test/unit/dialog/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ exports[`Dialog Dialog customVue demo works fine 1`] = `
<div
class="t-dialog__body"
>
自定义底部按钮,传入 ButttonProps
自定义底部按钮,传入 ButtonProps
</div>
<div
class="t-dialog__footer"
Expand Down
2 changes: 1 addition & 1 deletion test/unit/drawer/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ exports[`Drawer Drawer customVue demo works fine 1`] = `
class="t-button__text"
>
confrim
confirm
</span>
</button>
Expand Down
6 changes: 3 additions & 3 deletions test/unit/message/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ exports[`Message :props :closeBtn is a function, () => VNode. 1`] = `
</div>
`;

exports[`Message :props :closeBtn is a tring, equal "关闭". 1`] = `
exports[`Message :props :closeBtn is a string, equal "关闭". 1`] = `
<div
class="t-message t-is-info t-is-closable"
>
Expand Down Expand Up @@ -94,7 +94,7 @@ exports[`Message :props :closeBtn is true, render default close button. 1`] = `
</div>
`;

exports[`Message :props :default is a funtion, () => <b>这是重要信息</b> 1`] = `
exports[`Message :props :default is a function, () => <b>这是重要信息</b> 1`] = `
<div
class="t-message t-is-info"
>
Expand Down Expand Up @@ -148,7 +148,7 @@ exports[`Message :props :default is a string, 这是普通信息 1`] = `
</div>
`;

exports[`Message :props :icon is a funtion, () => MoreIcon 1`] = `
exports[`Message :props :icon is a function, () => MoreIcon 1`] = `
<div
class="t-message t-is-info"
>
Expand Down
Loading

0 comments on commit b4e7e8e

Please sign in to comment.