Skip to content

Change the language on some code blocks to match the code #783

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

Merged
merged 1 commit into from
Jan 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/api/global-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ For example, for runtime-dom, HostNode would be the DOM

Custom renderers can pass in the platform specific types like this:

```js
```ts
import { createRenderer } from 'vue'
const { render, createApp } = createRenderer<Node, Element>({
patchProp,
Expand Down
4 changes: 2 additions & 2 deletions src/api/refs-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ foo.value = 123 // ok!

If the type of the generic is unknown, it's recommended to cast `ref` to `Ref<T>`:

```js
```ts
function useState<State extends string>(initial: State) {
const state = ref(initial) as Ref<State> // state.value -> State extends string
return state
Expand All @@ -49,7 +49,7 @@ function useState<State extends string>(initial: State) {

Returns the inner value if the argument is a [`ref`](#ref), otherwise return the argument itself. This is a sugar function for `val = isRef(val) ? val.value : val`.

```js
```ts
function useFoo(x: number | Ref<number>) {
const unwrapped = unref(x) // unwrapped is guaranteed to be number now
}
Expand Down
2 changes: 1 addition & 1 deletion src/cookbook/debugging-in-vscode.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Please note that if the page uses a production/minified build of Vue.js (such as

The example above has a great workflow. However, there is an alternative option where you can use the [native debugger statement](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debugger) directly in your code. If you choose to work this way, it's important that you remember to remove the statements when you're done.

```js
```vue
<script>
export default {
data() {
Expand Down
6 changes: 3 additions & 3 deletions src/guide/migration/functional-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ export default {

Or, for those who preferred the `<template>` in a single-file component:

```js
// Vue 2 Functional Component Example with <template>
```vue
<!-- Vue 2 Functional Component Example with <template> -->
<template functional>
<component
:is="`h${props.level}`"
Expand Down Expand Up @@ -91,7 +91,7 @@ In 3.x, the performance difference between stateful and functional components ha

Using our `<dynamic-heading>` example from before, here is how it would look now.

```js{1,3,4}
```vue{1,3,4}
<template>
<component
v-bind:is="`h${$props.level}`"
Expand Down
2 changes: 1 addition & 1 deletion src/guide/migration/inline-template-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Most of the use cases for `inline-template` assumes a no-build-tool setup, where

The most straightforward workaround in such cases is using `<script>` with an alternative type:

```js
```html
<script type="text/html" id="my-comp-template">
<div>{{ hello }}</div>
</script>
Expand Down