You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 11, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 11, 2026. It is now read-only.
Activity
surmon-china commentedon May 2, 2017
你指这个吗?
https://github.com/surmon-china/angular-admin/blob/master/src/app/theme/components/baPictureUploader/baPictureUploader.html
其实就两个事件:
Hjyheart commentedon May 3, 2017
是 是这段代码 我不懂为什么这边要用到三个按钮 七牛云sdk绑定的那个按钮甚至都没有用 第一个按钮的点击事件只是去模拟点击第二个隐藏的按钮 就不是很懂这个逻辑 但不这么做似乎又传不上文件 就来讨教一下这个“三按钮”大法的原理
surmon-china commentedon May 3, 2017
https://github.com/surmon-china/angular-admin/blob/master/src/app/theme/components/baPictureUploader/baPictureUploader.component.ts#L150
https://github.com/surmon-china/angular-admin/blob/master/src/app/theme/components/baPictureUploader/baPictureUploader.component.ts#L20
https://angular.io/docs/ts/latest/api/core/index/Renderer-class.html#!#invokeElementMethod-anchor
看这里就明白啦,用几个按钮不重要,重要的是用按钮发起input控件原生的上传方法,使用的是
invokeElementMethod这个API。surmon-china commentedon May 3, 2017
另外,七牛云sdk提供的按钮确实没用上,而是直接调用了七牛云sdk的上传文件api。
代码在此:https://github.com/surmon-china/angular-admin/blob/master/src/app/theme/components/baPictureUploader/baPictureUploader.component.ts#L146
Hjyheart commentedon May 4, 2017
非常感谢