feat(markdown-vetur): 支持生成 attributes.json 的 options 属性 (#8545)
* feat(markdown-vetur): 支持生成 attributes.json 的 options 属性 * fix(markdown-vetur): 没有可选值不添加 options 属性
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/* eslint-disable no-continue */
|
||||
import { Articals } from './parser';
|
||||
import { formatType, removeVersion, toKebabCase } from './utils';
|
||||
import { formatOptions, formatType, removeVersion, toKebabCase } from './utils';
|
||||
import { VueTag } from './type';
|
||||
|
||||
function formatComponentName(name: string, tagPrefix: string) {
|
||||
@@ -64,11 +64,12 @@ export function formatter(
|
||||
const tag = findTag(vueTags, name);
|
||||
|
||||
table.body.forEach((line) => {
|
||||
const [name, desc, type, defaultVal] = line;
|
||||
const [name, desc, type, defaultVal, options] = line;
|
||||
tag.attributes!.push({
|
||||
name: removeVersion(name),
|
||||
default: defaultVal,
|
||||
description: desc,
|
||||
options: formatOptions(options),
|
||||
value: {
|
||||
type: formatType(type),
|
||||
kind: 'expression',
|
||||
|
||||
Reference in New Issue
Block a user