You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
826 B

2 months ago
  1. import { error } from '../../libs/function/index'
  2. export const mixinUpload = {
  3. watch: {
  4. // 监听accept的变化,判断是否符合个平台要求
  5. // 只有微信小程序才支持选择媒体,文件类型,所以这里做一个判断提示
  6. accept: {
  7. immediate: true,
  8. handler(val) {
  9. // #ifndef MP-WEIXIN
  10. if (val === 'all' || val === 'media') {
  11. error('只有微信小程序才支持把accept配置为all、media之一')
  12. }
  13. // #endif
  14. // #ifndef H5 || MP-WEIXIN
  15. if (val === 'file') {
  16. error('只有微信小程序和H5(HX2.9.9)才支持把accept配置为file')
  17. }
  18. // #endif
  19. }
  20. }
  21. }
  22. }