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

Update typescript.md to describe how to use typescript types without module bundler (closes #2042) #2137

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/v2/guide/typescript.md
Expand Up @@ -70,7 +70,8 @@ const Component = {
}
```

To use vue types in environment without module bundler you can create custom type definition file containing declare global (see https://www.typescriptlang.org/docs/handbook/declaration-merging.html)
To use Vue types in an environment without a module bundler, you can create a custom type definition file containing `declared global` (see [Declaration Merging
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The markup is broken here.

Copy link
Author

@realmerx realmerx Apr 22, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understood exactly what is broken in markup? Found a typo and added link to url label as well (if it conflicts with style then we can of course keep just the name in url label).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preview your markdown and you'll see what I mean.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. I am probably missing something obvious because I did preview and looks correct to me. Here is what I am testing:

https://github.com/vuejs/vuejs.org/blob/6e6891eeb139c6dc712169359677e1bf72dd3c4b/src/v2/guide/typescript.md

And here is what I am seeing:

image

](https://www.typescriptlang.org/docs/handbook/declaration-merging.html)).

``` ts
//global.d.ts - name does not matter
Expand Down