Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

正则表达式有问题 #6

Open
988494 opened this issue Jan 24, 2024 · 0 comments
Open

正则表达式有问题 #6

988494 opened this issue Jan 24, 2024 · 0 comments

Comments

@988494
Copy link

988494 commented Jan 24, 2024

  1. 目前源码中的正则表达式为:
const pxGlobalReg:RegExp = /(\d+)px/;

这个只会匹配一次,如果行内页面有多个,则第一个之外的不会转换,应该修复为:

const pxGlobalReg: RegExp = /(\d+)px/gi;
  1. 源代码中只匹配中的,但实际开发中,我们有些尺寸是<script setup lang="ts"></script>中动态的,
    推荐将
const templateReg:RegExp = /<template>([\s\S]+)<\/template>/gi;

修改为

const templateReg: RegExp = /([\s\S]+)/gi;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant