close
The Wayback Machine - https://web.archive.org/web/20211014224235/https://github.com/quasarframework/quasar/issues/10773
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

createUploaderComponent doesn't support emits as an object #10773

Open
2 of 14 tasks
IlCallo opened this issue Sep 22, 2021 · 0 comments
Open
2 of 14 tasks

createUploaderComponent doesn't support emits as an object #10773

IlCallo opened this issue Sep 22, 2021 · 0 comments

Comments

@IlCallo
Copy link
Member

@IlCallo IlCallo commented Sep 22, 2021

Describe the bug
When createUploaderComponent has been created, emits specification only described the usage as an array (eg. ['update:label', 'change']), later on they added the ability to provide an object for stricter type checking and validation, very much like props.
Currently createUploaderComponent only supports emits as an array and props as an object

Codepen/jsFiddle/Codesandbox (required)
Fork a Codepen (https://codepen.quasar.dev) or a jsFiddle (https://jsfiddle.quasar.dev) or a Codesandbox (https://codesandbox.quasar.dev) and hit save then copy-paste link here.

To Reproduce
Steps to reproduce the behavior:

import { createUploaderComponent } from 'quasar';
import myUploaderPlugin from './my-uploader-plugin';

export default createUploaderComponent({
  name: 'MyUploader',
  emits: {
    'change': (newValue: string) => true
  },
  injectPlugin: myUploaderPlugin,
});

then use the component anywhere and a warning (at least) will be fired

Expected behavior
props and emits should support both Array and Object styles

Platform (please complete the following information):
Quasar Version: 2.x
@quasar/app Version: 3.x

Quasar mode:

  • SPA
  • SSR
  • PWA
  • Electron
  • Cordova
  • Capacitor
  • BEX

Tested on:

  • SPA
  • SSR
  • PWA
  • Electron
  • Cordova
  • Capacitor
  • BEX

OS: Linux 18.04
Node: 12.22.6
NPM: 6.14.15
Yarn: 1.22.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant