feat: provide english version of web-types (#10207)

This commit is contained in:
neverland
2022-01-17 16:06:55 +08:00
committed by GitHub
parent d4aebef89c
commit b3d6611c74
5 changed files with 13 additions and 13 deletions
+8 -8
View File
@@ -3,9 +3,9 @@ import { VueTag, VeturTags, VeturAttributes, VeturAttribute } from './type';
export function genVeturTags(tags: VueTag[]) {
const veturTags: VeturTags = {};
tags.forEach(tag => {
tags.forEach((tag) => {
veturTags[tag.name] = {
attributes: tag.attributes ? tag.attributes.map(item => item.name) : [],
attributes: tag.attributes ? tag.attributes.map((item) => item.name) : [],
};
});
@@ -15,16 +15,16 @@ export function genVeturTags(tags: VueTag[]) {
export function genVeturAttributes(tags: VueTag[]) {
const veturAttributes: VeturAttributes = {};
tags.forEach(tag => {
tags.forEach((tag) => {
if (tag.attributes) {
tag.attributes.forEach(attr => {
let attribute: VeturAttribute = {
tag.attributes.forEach((attr) => {
const attribute: VeturAttribute = {
type: attr.value.type,
description: `${attr.description}, 默认值: ${attr.default}`
}
description: `${attr.description}, Default: ${attr.default}`,
};
if (attr.options.length > 0) {
attribute.options = attr.options
attribute.options = attr.options;
}
veturAttributes[`${tag.name}/${attr.name}`] = attribute;