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

Typescript support #186

Open
qazxsw99 opened this issue Mar 14, 2018 · 5 comments
Open

Typescript support #186

qazxsw99 opened this issue Mar 14, 2018 · 5 comments

Comments

@qazxsw99
Copy link

This is awesome project indeed. Is it possible to add definition file for Typescript since vue 2.5 have greatly improved on it.

@wxsms
Copy link
Member

wxsms commented Mar 14, 2018

I am not a TS user, and have no idea on how to implement this. contributions are very welcome 😄

@munozcotelo
Copy link
Contributor

I get this error when using typescript, "TS7016: Could not find a declaration file for module 'uiv'"
Is it planned to add declaration files?

@newuser
Copy link

newuser commented Jul 21, 2018

There are so many libs without updated definitions in typescript. Use ambient declarations :
declare module "uiv" { }

@matheusgrieger
Copy link

For it to work properly following the project documentation with import * as uiv, I had to create declarations like this:

declare module 'uiv' {
  const uiv: any;
  export = uiv;
}

declare module 'uiv/src/locale/lang/pt-BR' {
  const locale: any;
  export default locale;
}

I'm not an expert with type declarations, otherwise I would happily contribute to the project...

@vilazae
Copy link

vilazae commented Sep 25, 2018

I use it as follows:
First import the components with requiere

const uiv = require( "uiv" );
const Dropdown   = uiv.Dropdown;
const DatePicker = uiv.DatePicker;
const TimePicker = uiv.TimePicker;

Then, register them as components

new Vue( {
    components: {
        Dropdown,
        DatePicker,
        TimePicker
    }
} )

Hopefully this can help you

@wxsms wxsms pinned this issue Oct 4, 2020
@wxsms wxsms unpinned this issue Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants