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

cli 方式创建的 typeScript 项目无法引入 uview-ui #237

Open
1014156094 opened this issue Jul 13, 2020 · 10 comments
Open

cli 方式创建的 typeScript 项目无法引入 uview-ui #237

1014156094 opened this issue Jul 13, 2020 · 10 comments

Comments

@1014156094
Copy link

1014156094 commented Jul 13, 2020

image

运行 yarn dev:mp-weixin 后有报错
需要在 sfc.d.ts 文件加上 declare module 'uview-ui'; 才行

@tttao7
Copy link
Collaborator

tttao7 commented Jul 21, 2020

uView暂不支持ts,感谢您的issue。

@SmugglerintheGalaxy
Copy link

uView暂不支持ts,感谢您的问题。

请问贵框架什么时候考虑支持ts,想用你们的来练练手

@tttao7
Copy link
Collaborator

tttao7 commented Jul 27, 2020

请问贵框架什么时候考虑支持ts,想用你们的来练练手

有个小伙伴pull request了一个typescript相关的东西 您可以去看看 由于精力有限 我们暂时还没有准备去适配ts

@cat-walk
Copy link

uView暂不支持ts,感谢您的问题。

请问贵框架什么时候考虑支持ts,想用你们的来练练手

同求,后期若有精力,还望适配ts,感谢。

@SignDawn
Copy link

不支持 ts 那只能重新建项目了

@hesi726
Copy link

hesi726 commented Feb 19, 2021

首先说一下, uview 只是没有导出 ts 的类型,但并不是不支持 ts 的项目。。
我的项目使用 TS,再引入 uview-ui 是没有问题的。。。
使用 uniapp 新建一个项目,然后再引入 uviewui , 正常运行。。
唯一有一个小BUG在 u-icon 中, 那个 import '../../iconfont.css' 这儿会报错误。。即使我已经导入了 css-loader, 还是说无法找到文件。。
但是也很好解决, 我是把 iconfont.css 复制成 iconfont.scss, 然后改上面的 import , 就没有问题了。。
当然,希望 uview 修改一下源代码。。

image

@SignDawn
Copy link

首先说一下, uview 只是没有导出 ts 的类型,但并不是不支持 ts 的项目。。
我的项目使用 TS,再引入 uview-ui 是没有问题的。。。
使用 uniapp 新建一个项目,然后再引入 uviewui , 正常运行。。
唯一有一个小BUG在 u-icon 中, 那个 import '../../iconfont.css' 这儿会报错误。。即使我已经导入了 css-loader, 还是说无法找到文件。。
但是也很好解决, 我是把 iconfont.css 复制成 iconfont.scss, 然后改上面的 import , 就没有问题了。。
当然,希望 uview 修改一下源代码。。

image

你好,可以把你引入 uview 的方式的部门代码粘上来吗?

@hesi815
Copy link

hesi815 commented Feb 19, 2021

写了一个例子项目,
https://github.com/hesi726/UviewUI_Ts_Example

image

@hesi815
Copy link

hesi815 commented Feb 19, 2021

我习惯 把 ts 和 vue 分开, 看个人风格吧。。。

@yangdan8
Copy link

#1003

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

8 participants