Skip to content

Fix inconsistent SFC styling #990

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
Oct 3, 2018
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
19 changes: 11 additions & 8 deletions docs/guides/dom-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,22 @@ wrapper.trigger('click', { button: 0 })

```html
<template>
<div>
<button class="yes" @click="callYes">Yes</button>
<button class="no" @click="callNo">No</button>
</div>
<div>
<button class="yes" @click="callYes">Yes</button>
<button class="no" @click="callNo">No</button>
</div>
</template>

<script>
export default {
name: 'YesNoComponent',

props: {
callMe: {
type: Function
}
},

methods: {
callYes() {
this.callMe('yes')
Expand All @@ -60,7 +63,6 @@ export default {
}
}
</script>

```

**Test**
Expand Down Expand Up @@ -93,8 +95,9 @@ This component allows to increment/decrement the quantity using various keys.

```html
<template>
<input type="text" @keydown.prevent="onKeydown" v-model="quantity" />
<input type="text" @keydown.prevent="onKeydown" v-model="quantity" />
</template>

<script>
const KEY_DOWN = 40
const KEY_UP = 38
Expand All @@ -107,6 +110,7 @@ export default {
quantity: 0
}
},

methods: {
increment() {
this.quantity += 1
Expand All @@ -132,14 +136,14 @@ export default {
}
}
},

watch: {
quantity: function (newValue) {
this.$emit('input', newValue)
}
}
}
</script>

```

**Test**
Expand Down Expand Up @@ -182,7 +186,6 @@ describe('Key event tests', () => {
expect(wrapper.vm.quantity).toBe(13)
})
})

```

**Limitations**
Expand Down
28 changes: 14 additions & 14 deletions docs/guides/testing-async-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ The below component makes an API call when a button is clicked, then assigns the
</template>

<script>
import axios from 'axios'

export default {
data () {
return {
value: null
}
},

methods: {
async fetchResults () {
const response = await axios.get('mock/service')
this.value = response.data
}
import axios from 'axios'

export default {
data () {
return {
value: null
}
},

methods: {
async fetchResults () {
const response = await axios.get('mock/service')
this.value = response.data
}
}
}
</script>
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ Create a file in `src` named `Counter.vue`:

``` html
<template>
<div>
{{ count }}
<button @click="increment">Increment</button>
</div>
<div>
{{ count }}
<button @click="increment">Increment</button>
</div>
</template>

<script>
Expand Down