Skip to content

Whitespace changes suggested by Prettier #1036

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
May 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
6 changes: 3 additions & 3 deletions src/api/application-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -329,14 +329,14 @@ setTimeout(() => app.unmount(), 5000)
export default {
install(app) {
const version = Number(app.version.split('.')[0])

if (version < 3) {
console.warn('This plugin requires Vue 3')
}

// ...
}
}
```

- **See also**: [Global API - version](/api/global-api.html#version)
8 changes: 4 additions & 4 deletions src/api/built-in-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const { KeepAlive, Teleport, Transition, TransitionGroup } = Vue
import { KeepAlive, Teleport, Transition, TransitionGroup } from 'vue'
```

`<component>` and `<slot>` are component-like features of template syntax. They are not true components and they can't be imported like the components shown above.
`<component>` and `<slot>` are component-like features of template syntax. They are not true components and they can't be imported like the components shown above.

## component

Expand Down Expand Up @@ -45,13 +45,13 @@ import { KeepAlive, Teleport, Transition, TransitionGroup } from 'vue'

```js
const { Transition, TransitionGroup } = Vue

const Component = {
components: {
Transition,
TransitionGroup
},

template: `
<component :is="isGroup ? 'TransitionGroup' : 'Transition'">
...
Expand All @@ -60,7 +60,7 @@ import { KeepAlive, Teleport, Transition, TransitionGroup } from 'vue'
}
```

Registration is not required if you pass the component itself to `is` rather than its name.
Registration is not required if you pass the component itself to `is` rather than its name.

- **See also:** [Dynamic Components](../guide/component-dynamic-async.html)

Expand Down
2 changes: 1 addition & 1 deletion src/api/instance-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
- **Option: deep**

To also detect nested value changes inside Objects, you need to pass in `deep: true` in the options argument. This option also can be used to watch array mutations.

> Note: when mutating (rather than replacing) an Object or an Array and watch with deep option, the old value will be the same as new value because they reference the same Object/Array. Vue doesn't keep a copy of the pre-mutate value.

```js
Expand Down
2 changes: 2 additions & 0 deletions src/api/options-assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
A hash of directives to be made available to the component instance.

- **Usage:**

```js
const app = createApp({})

Expand All @@ -35,6 +36,7 @@
A hash of components to be made available to the component instance.

- **Usage:**

```js
const Foo = {
template: `<div>Foo</div>`
Expand Down
2 changes: 1 addition & 1 deletion src/api/options-misc.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

- **Type:** `Array<string>`

- **Default:** `{{ "['\u007b\u007b', '\u007d\u007d']" }}`
- **Default:** `{{ "['\u007b\u007b', '\u007d\u007d']" }}`

- **Restrictions:** This option is only available in the full build, with in-browser template compilation.

Expand Down
2 changes: 1 addition & 1 deletion src/api/refs-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ isReactive(foo.value) // false

## `triggerRef`

Execute any effects tied to a [`shallowRef`](#shallowref) manually.
Execute any effects tied to a [`shallowRef`](#shallowref) manually.

```js
const shallow = shallowRef({
Expand Down
90 changes: 45 additions & 45 deletions src/coc/index.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
# Code Of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, political party, or sexual identity and orientation. Note, however, that religion, political party, or other ideological affiliation provide no exemptions for the behavior we outline as unacceptable in this Code of Conduct.
## Our Standards
Examples of behavior that contributes to creating a positive environment include:
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
- The use of sexualized language or imagery and unwelcome sexual attention or advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: https://www.contributor-covenant.org
# Code Of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, political party, or sexual identity and orientation. Note, however, that religion, political party, or other ideological affiliation provide no exemptions for the behavior we outline as unacceptable in this Code of Conduct.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

- The use of sexualized language or imagery and unwelcome sexual attention or advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org
2 changes: 1 addition & 1 deletion src/community/partners.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ Vue Partners are premium shops that provide first-class Vue consulting and devel

## Active Partners

<community-partners-index/>
<community-partners-index/>
2 changes: 1 addition & 1 deletion src/community/team.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Meet the Team

<community-team-index/>
<community-team-index/>
2 changes: 1 addition & 1 deletion src/community/themes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Themes

<community-themes-index/>
<community-themes-index/>
2 changes: 1 addition & 1 deletion src/guide/a11y-resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The World Health Organization estimates that 15% of the world's population has s
There are a huge range of disabilities, which can be divided roughly into four categories:

- _[Visual](https://webaim.org/articles/visual/)_ - These users can benefit from the use of screen readers, screen magnification, controlling screen contrast, or braille display.
- _[Auditory](https://webaim.org/articles/auditory/)_ - These users can benefit from captioning, transcripts or sign language video.
- _[Auditory](https://webaim.org/articles/auditory/)_ - These users can benefit from captioning, transcripts or sign language video.
- _[Motor](https://webaim.org/articles/motor/)_ - These users can benefit from a range of [assistive technologies for motor impairments](https://webaim.org/articles/motor/assistive): voice recognition software, eye tracking, single-switch access, head wand, sip and puff switch, oversized trackball mouse, adaptive keyboard or other assistive technologies.
- _[Cognitive](https://webaim.org/articles/cognitive/)_ - These users can benefit from supplemental media, structural organization of content, clear and simple writing.

Expand Down
2 changes: 1 addition & 1 deletion src/guide/composition-api-template-refs.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ But a key difference to lifecycle hooks is that `watch()` and `watchEffect()` ef
const root = ref(null)

watchEffect(() => {
// This effect runs before the DOM is updated, and consequently,
// This effect runs before the DOM is updated, and consequently,
// the template ref does not hold a reference to the element yet.
console.log(root.value) // => null
})
Expand Down
1 change: 1 addition & 0 deletions src/guide/contributing/doc-style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export default {
````

**Rendered Output**

```js
export default {
name: 'MyComponent'
Expand Down
2 changes: 1 addition & 1 deletion src/guide/migration/array-refs.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: v-for Array Refs
badges:
- breaking
- breaking
---

# {{ $frontmatter.title }} <MigrationBadges :badges="$frontmatter.badges" />
Expand Down
2 changes: 1 addition & 1 deletion src/guide/migration/v-bind.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ When dynamically binding attributes on an element, a common scenario involves us

## 2.x Syntax

In 2.x, if an element has both `v-bind="object"` and an identical individual property defined, the individual property would always overwrite bindings in the `object`.
In 2.x, if an element has both `v-bind="object"` and an identical individual property defined, the individual property would always overwrite bindings in the `object`.

```html
<!-- template -->
Expand Down
2 changes: 1 addition & 1 deletion src/guide/reactivity.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ But knowing what code is running is just one part of the puzzle. How does Vue kn

We can't track reassignments of local variables like those in our earlier examples, there's just no mechanism for doing that in JavaScript. What we can track are changes to object properties.

When we return a plain JavaScript object from a component's `data` function, Vue will wrap that object in a [Proxy](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) with handlers for `get` and `set`. Proxies were introduced in ES6 and allow Vue 3 to avoid some of the reactivity caveats that existed in earlier versions of Vue.
When we return a plain JavaScript object from a component's `data` function, Vue will wrap that object in a [Proxy](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) with handlers for `get` and `set`. Proxies were introduced in ES6 and allow Vue 3 to avoid some of the reactivity caveats that existed in earlier versions of Vue.

<div class="reactivecontent">
<common-codepen-snippet title="Proxies and Vue's Reactivity Explained Visually" slug="VwmxZXJ" tab="result" theme="light" :height="500" :editable="false" :preview="false" />
Expand Down
9 changes: 6 additions & 3 deletions src/guide/single-file-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Most of the time when developing a third-party library we want to build it in a
We will need to install Rollup and a few dependencies:

```bash
npm install --save-dev rollup @rollup/plugin-commonjs rollup-plugin-vue
npm install --save-dev rollup @rollup/plugin-commonjs rollup-plugin-vue
```

These are the minimal amount of rollup plugins that we need to use to compile the code in an `esm` module. We may want to also add [rollup-plugin-babel](https://github.com/rollup/plugins/tree/master/packages/babel) to transpile their code and [node-resolve](https://github.com/rollup/plugins/tree/master/packages/node-resolve) if we use dependencies that we want to bundle with our library.
Expand All @@ -100,7 +100,7 @@ export default {
// this is the file containing all our exported components/functions
input: 'src/index.js',
// this is an array of outputted formats
output: [
output: [
{
file: pkg.module, // the name of our esm library
format: 'esm', // the format of choice
Expand Down Expand Up @@ -143,7 +143,8 @@ Here we are specifying:

To also build `umd` and `cjs` modules we can simply add a few lines of configuration to our `rollup.config.js` and `package.json`

##### rollup.config.js
##### rollup.config.js

```js
output: [
...
Expand All @@ -163,7 +164,9 @@ output: [
},
]
```

##### package.json

```json
"module": "dist/my-library-name.esm.js",
"main": "dist/my-library-name.cjs.js",
Expand Down
10 changes: 5 additions & 5 deletions src/guide/teleport.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Vue encourages us to build our UIs by encapsulating UI and related behavior into components. We can nest them inside one another to build a tree that makes up an application UI.

However, sometimes a part of a component's template belongs to this component logically, while from a technical point of view, it would be preferable to move this part of the template somewhere else in the DOM, outside of the Vue app.
However, sometimes a part of a component's template belongs to this component logically, while from a technical point of view, it would be preferable to move this part of the template somewhere else in the DOM, outside of the Vue app.

A common scenario for this is creating a component that includes a full-screen modal. In most cases, you'd want the modal's logic to live within the component, but the positioning of the modal quickly becomes difficult to solve through CSS, or requires a change in component composition.

Expand All @@ -21,7 +21,7 @@ Consider the following HTML structure.
</body>
```

Let's take a look at `modal-button`.
Let's take a look at `modal-button`.

The component will have a `button` element to trigger the opening of the modal, and a `div` element with a class of `.modal`, which will contain the modal's content and a button to self-close.

Expand All @@ -44,7 +44,7 @@ app.component('modal-button', {
</div>
`,
data() {
return {
return {
modalOpen: false
}
}
Expand All @@ -55,7 +55,7 @@ When using this component inside the initial HTML structure, we can see a proble

Teleport provides a clean way to allow us to control under which parent in our DOM we want a piece of HTML to be rendered, without having to resort to global state or splitting this into two components.

Let's modify our `modal-button` to use `<teleport>` and tell Vue "**teleport** this HTML **to** the "**body**" tag".
Let's modify our `modal-button` to use `<teleport>` and tell Vue "**teleport** this HTML **to** the "**body**" tag".

```js
app.component('modal-button', {
Expand All @@ -77,7 +77,7 @@ app.component('modal-button', {
</teleport>
`,
data() {
return {
return {
modalOpen: false
}
}
Expand Down
Loading