wechat-component-vscode 微信自定义组件插件
组件跳转实现
- 组件名称必须和 wxml 文件名相同(使用 endsWith 匹配的);
Web Components 语法(暂无)
components.d.json 自定义组件配置文件用于代码补全和提示, 组件名称支持多个用逗号分隔, attributes 会合并, description 会覆盖
// components.d.json 类型定义
export type IComponentsTags = {
// 组件名称
[key: string]: {
// 组件描述
description: string,
attributes: {
// 属性名称
[key: string]: {
// 属性描述
description: string,
// 属性类型
type: string,
// 属性可选值
values: (string | number)[],
},
},
},
};
// 例子
{
"cf-test": {
"description": "My component 组件",
"attributes": {
"type": {
"description": "类型",
"type": "String",
"values": ["primary", "success", "info", "warning", "danger"]
}
}
}
}
推荐插件
| |