当前位置: 首页 > news >正文

vue2 组件库之vetur提示

当我们开发完自定义UI组件库后,在项目中使用时,想要达到以下提示效果,组件提示与属性提示,有什么解决方案呢:

 事实上,这是vetur的功能,原文如下:

Component Data | Vetur

If a package listed in dependencies has a vetur key in its package.json, then Vetur will try to read the tags / attributes specified by that key.

{"vetur": {"tags": "dist/vetur/tags.json","attributes": "dist/vetur/attributes.json"}
}

By bundling the tags / attributes definitions together with the framework library, you ensure that users will always get the matching tags / attributes with the specific version of your library they are using.

我的步骤如下:

1、package.json

"vetur": {"tags": "./vetur/tags.json","attributes": "./vetur/attributes.json"}

2、tags.json

{"Card": {// description放在首位,否则无法识别"description": "这是一个全新的筛选框架组件",// "slotTip", "emitTip" 扩展slot与emit,这两个不在props中。"attributes": ["type","slotTip", "emitTip"]}
}

3、attributes.json

{"type": {"description": "类型"},"slotTip": {"description": "包含以下slot:title、content"},"emitTip": {"description": "包含以下Events:query(説明:插槽searchInput的@keyup.enter.native的事件)"}
}

 发布npm,项目更新私库(有时需要重启vscode)之后,便可以了。

http://www.lryc.cn/news/146652.html

相关文章:

  • 慕课网 Go工程师 第三周 package和gomodules章节
  • 【ES6】JavaScript 中的数组方法reduce
  • 数据结构--树4.2(二叉树)
  • 详解Numpy(基于jupyter notbook)
  • uniapp实现:点击拨打电话,弹出电话号码列表,可以选择其中一个进行拨打
  • swc-loader Segmentation fault “$NODE_EXE“ “$NPM_CLI_JS“ “$@“
  • Leetcode78. 子集
  • 百度“AI智障”到AI智能体验之旅
  • R中当并行运算遇到C++函数时,让foreach+Rcpp一起工作
  • 实现带头双向循环链表
  • Mysql 表字符集变更
  • golang抓取tcp包的实现
  • oauth2.0第2季 分布式认证与授权实现单点登录
  • SpringBoot一些困惑及梳理
  • PostgreSQL汉字转拼音首字母
  • HBuilderX修改manifest.json设置,解决跨域问题(CORS、Cross-Origin)
  • AR地图微信小程序:数字化时代下地图应用的新突破
  • 成集云 | 抖店客户静默下单催付数据同步钉钉 | 解决方案
  • C++中的运算符总结(5):按位逻辑运算符
  • 《异常检测——从经典算法到深度学习》22 Kontrast: 通过自监督对比学习识别软件变更中的错误
  • 大数据风控介绍
  • Linux内核学习(九)—— 虚拟文件系统(基于Linux 2.6内核)
  • 【模拟】算法实战
  • 各个微服务模块之间互相依赖调用的问题
  • 理论转换实践之keepalived+nginx实现HA
  • 华为OD七日集训第1期复盘 - 按算法分类,由易到难,循序渐进,玩转OD(文末送书)
  • MPI之持久化通信句柄与非持久化通信句柄
  • 搭建个人备忘录中心服务memos、轻量级笔记服务
  • 探究代理技术在网络安全、爬虫与HTTP通信中的多重应用
  • vue左侧漏斗切换 echart图表动态更新