didi / mand-mobile

💰 A mobile UI toolkit, based on Vue.js 2, designed for financial scenarios.
https://didi.github.io/mand-mobile
Apache License 2.0
3.46k stars 772 forks source link

ActionSheet error #177

Closed mt-ik closed 6 years ago

mt-ik commented 6 years ago

Mand Mobile Version

OS Version & Browser Version

mac 、chrome

Node Version, Package Management Tool

node: v8.11.3、 yarn: v.1.7.0

Recurring Links

Recurring Steps

Expectant Behaviors

Actual Behaviors

引用 "ActionSheet" error: Argument of type '{ components: { [x: string]: ActionSheet | typeof Button; }; }' is not assignable to parameter of type 'VueClass'. Object literal may only specify known properties, but 'components' does not exist in type 'VueClass'. Did you mean to write 'component'?

xxyan0205 commented 6 years ago

推荐静态方法的形式使用 https://didi.github.io/mand-mobile/#/zh-CN/docs/components/feedback/action-sheet?anchor=create%28props%29

xxyan0205 commented 6 years ago

Toast/Dialog/ActionSheet 的类型声明目前都不是class,后期会把Dialog和ActionSheet拓展为class, 现在如果想以组件形式使用可以在注册时加上as any跳过类型检查

mt-ik commented 6 years ago

ok, 但是我有个疑问 之前 使用时只是Dialog的.d.ts问题, ActionSheet检测时没问题, 但是Dialog修复后,ActtionSheet才出现这个问题, 原谅我不清楚这中间是否有内部依赖。

xxyan0205 commented 6 years ago

之前ActionSheet是以class形式导出并且没有静态方法的导出,这次调整是把前面提到的Toast/Dialog/ActionSheet 统一了,他们之间没有相互依赖