Skip to content

Commit 261e7d0

Browse files
committed
chore: update token error
1 parent b393a0a commit 261e7d0

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

antd-tools/generator-types/src/formatter.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export function formatter(
9191
!tableTitle.includes('()')
9292
) {
9393
const childTag: VueTag = {
94-
name: getComponentName(tableTitle.replaceAll('.', '').replaceAll('/', ''), tagPrefix),
94+
name: getComponentName(tableTitle.replace(/\.|\//g, ''), tagPrefix),
9595
slots: [],
9696
events: [],
9797
attributes: [],

antd-tools/generator-types/src/index.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { outputFileSync, readFileSync } from 'fs-extra';
77
import type { Options, VueTag } from './type';
88
import { getComponentName, normalizePath, toKebabCase } from './utils';
99
import { genVeturAttributes, genVeturTags } from './vetur';
10+
import { flatMap } from 'lodash';
1011

1112
async function readMarkdown(options: Options): Promise<Map<String, VueTag>> {
1213
const mdPaths = await glob(normalizePath(`${options.path}/**/*.md`));
@@ -22,7 +23,7 @@ async function readMarkdown(options: Options): Promise<Map<String, VueTag>> {
2223
})
2324
.filter(item => item) as VueTag[][];
2425
const tags: Map<String, VueTag> = new Map();
25-
data.flatMap(item => item).forEach(mergedTag => mergeTag(tags, mergedTag));
26+
flatMap(data, item => item).forEach(mergedTag => mergeTag(tags, mergedTag));
2627
return tags;
2728
}
2829

antd-tools/generator-types/src/parser.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function readLine(input: string) {
2727
function splitTableLine(line: string) {
2828
line = line.replace(/\\\|/g, 'JOIN');
2929

30-
const items = line.split('|').map(item => item.trim().replaceAll('JOIN', '|'));
30+
const items = line.split('|').map(item => item.trim().replace(/JOIN/g, '|'));
3131

3232
// remove pipe character on both sides
3333
items.pop();

site/src/hooks/useSiteToken.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const useSiteToken = () => {
3737
() => {
3838
styleDom = styleDom || document.createElement('style');
3939
const tokenValue = mergedToken.value.token;
40-
const demoGridColor = token.colorPrimary;
40+
const demoGridColor = token.value.colorPrimary;
4141
styleDom.innerHTML = `
4242
:root {
4343
--header-height: ${tokenValue.headerHeight}px;

0 commit comments

Comments
 (0)