chore: update token error

pull/6316/head
tangjinzhou 2023-02-27 11:00:19 +08:00
parent b393a0a2dd
commit 261e7d0857
4 changed files with 5 additions and 4 deletions

View File

@ -91,7 +91,7 @@ export function formatter(
!tableTitle.includes('()')
) {
const childTag: VueTag = {
name: getComponentName(tableTitle.replaceAll('.', '').replaceAll('/', ''), tagPrefix),
name: getComponentName(tableTitle.replace(/\.|\//g, ''), tagPrefix),
slots: [],
events: [],
attributes: [],

View File

@ -7,6 +7,7 @@ import { outputFileSync, readFileSync } from 'fs-extra';
import type { Options, VueTag } from './type';
import { getComponentName, normalizePath, toKebabCase } from './utils';
import { genVeturAttributes, genVeturTags } from './vetur';
import { flatMap } from 'lodash';
async function readMarkdown(options: Options): Promise<Map<String, VueTag>> {
const mdPaths = await glob(normalizePath(`${options.path}/**/*.md`));
@ -22,7 +23,7 @@ async function readMarkdown(options: Options): Promise<Map<String, VueTag>> {
})
.filter(item => item) as VueTag[][];
const tags: Map<String, VueTag> = new Map();
data.flatMap(item => item).forEach(mergedTag => mergeTag(tags, mergedTag));
flatMap(data, item => item).forEach(mergedTag => mergeTag(tags, mergedTag));
return tags;
}

View File

@ -27,7 +27,7 @@ function readLine(input: string) {
function splitTableLine(line: string) {
line = line.replace(/\\\|/g, 'JOIN');
const items = line.split('|').map(item => item.trim().replaceAll('JOIN', '|'));
const items = line.split('|').map(item => item.trim().replace(/JOIN/g, '|'));
// remove pipe character on both sides
items.pop();

View File

@ -37,7 +37,7 @@ const useSiteToken = () => {
() => {
styleDom = styleDom || document.createElement('style');
const tokenValue = mergedToken.value.token;
const demoGridColor = token.colorPrimary;
const demoGridColor = token.value.colorPrimary;
styleDom.innerHTML = `
:root {
--header-height: ${tokenValue.headerHeight}px;