npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ng2vue

v0.7.4

Published

此为0.7.x实验版,仅做粗略转换,转换后仍需要人工处理

Downloads

851

Readme

angular to Vue (vue3)

此为0.7.x实验版,仅做粗略转换,转换后仍需要人工处理

整个工具的依赖himalaya处理html, 依赖typescript处理ts.

此工具包含一部分开发团队特殊转换规则,非团队用户使用时需要额外注意!!

  1. 模板中能处理大部分 v-if,v-for,传值属性:=,事件方法 @click 等
  2. p-xxx组件标签批量替换成了el-xxx标签,支持组件:el-input、el-input-number、el-button、el-dialog、el-select、el-date-picker、vxe-table(base-table)
  3. ts中 根据angular类属性, 声明对应响应变量 let xxx = ref('test'); 或 let xxx = reactive({}); 和类成员方法生成为函数定义
  4. ts对 ngOnInit 处理改名为OnInit, 在生命周期 onMounted 会调用 OnInit方法, constructor方法会转为自执行闭包
  5. ts中对http.get http.post的subscribe 和 toPromise 处理 改为 await 方式 自动加上async,并加上try catch语句
  6. 模板中对组件标签如果无子元素,标记为自闭合标签
  7. 模板中对<div>{{ '处理' }}<div> 处理为 <div>处理</div>
  8. ts中对 getter setter 转换为计算属性
  9. 模板中支持部分组件上ref转换,如属性 #xxxx 转换为 ref="xxxx"

使用方法

  1. 安装依赖 npm i -g ng2vue

  2. 运行 ng2vue <angular组件目录>

    例如:ng2vue D:\workplace\base-UI\projects\eam\src\app\router\eam-pad\equipment-spot-check (会在同目录下生成一个同名的vue组件的文件)