Files
Vue3Template/tsvue/memo.txt
2024-09-27 00:58:46 +08:00

34 lines
1.9 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

【实现】1: 指令的实现可以考虑采用注解的方式实现
思路:
1: decorators/ 文件夹实现一个注解,可以放在 directive 的方法上
2: 注解收集到方法名,作为指令名,方法函数作为处理函数,然后保存到数组
3: init.ts 初始化文件中加载数组自动装入Vue中
【实现】2: 通过注解实现mixin自动注入
【实现】3: 非Vue插件也使用注解进行全局注入并挂载到Vue原型上。
【未实现/放弃】4简化init.run.ts注入运行类过程
状态:尝试过了,不行,已放弃....
【实现】5浏览器控制台console启动的Banner和vue-cli-plugin-autorouter合并到一起作为一个插件包。
【实现】6简化 @GET@POST等注解去除参数用方法名作为ApiList的Key。
【实现】7每次添加新的组件时都需要手动执行命令 vue-cli-service route 进而重新生成路由配置文件对懒人而言太TM麻烦了
解决思路:
1使用 gulp监听 /src/application/page 文件夹,当发生文件的增,删,改的时候都在后台自动执行命令 vue-cli-service route
2vue-cli-service route 会重新生成配置文件,然后 vue-cli-service serve 会自动重启当前网站
3开发者只需要手动刷新一下页面新路由配置即刻生效。
【未实现】8完善vue-cli-plugin-autorouter继续实现可以自定义参数并能够作为单独的依赖包被使用到其他Vue项目上。
问题如果要能在其他Vue项目上也被使用那么现在的插件包就不能基于 vue-cli-service因为Vue cli 2.x 或者其他手配的
Vue项目没有vue-cli-service。
所以需要脱离vue-cli-service作为一个单独的 nodejs 包才可以实现所有Vue项目全部通用。
【实现】9cli脚手架一键创建项目