Skip to content

Commit 0039fb9

Browse files
Jinjiangyyx990803
authored andcommitted
[docs] typos (vuejs#1277)
1 parent 8045259 commit 0039fb9

File tree

7 files changed

+39
-30
lines changed

7 files changed

+39
-30
lines changed

docs/guide/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ module.exports = {
4848
test: /\.vue$/,
4949
loader: 'vue-loader'
5050
},
51-
// this will apply to both plain .js files
52-
// AND <script> blocks in vue files
51+
// this will apply to both plain `.js` files
52+
// AND `<script>` blocks in `.vue` files
5353
{
5454
test: /\.js$/,
5555
loader: 'babel-loader'
5656
},
57-
// this will apply to both plain .css files
58-
// AND <style> blocks in vue files
57+
// this will apply to both plain `.css` files
58+
// AND `<style>` blocks in `.vue` files
5959
{
6060
test: /\.css$/,
6161
use: [

docs/guide/asset-url.md

+9
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ createElement('img', {
2020

2121
By default the following tag/attribute combinations are transformed, and can be configured using the [transformAssetUrls](../options.md#transformasseturls) option.
2222

23+
``` js
24+
{
25+
video: ['src', 'poster'],
26+
source: 'src',
27+
img: 'src',
28+
image: 'xlink:href'
29+
}
30+
```
31+
2332
In addition, if you have configured to use [css-loader](https://github.com/webpack-contrib/css-loader) for the `<style>` blocks, asset URLs in your CSS will also be processed in a similar fashion.
2433

2534
## Transform Rules

docs/guide/css-modules.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,14 @@ Refer to the [CSS Modules spec](https://github.com/css-modules/css-modules) for
8888

8989
## Opt-in Usage
9090

91-
If you only want to use CSS Modules in some of your Vue components, you can use a `oneOf` rule and check for the `module` string in resourceQuery:
91+
If you only want to use CSS Modules in some of your Vue components, you can use a `oneOf` rule and check for the `module` string in `resourceQuery`:
9292

9393
``` js
9494
// webpack.config.js -> module.rules
9595
{
9696
test: /\.css$/,
9797
oneOf: [
98-
// this matches <style module>
98+
// this matches `<style module>`
9999
{
100100
resourceQuery: /module/,
101101
use: [
@@ -109,7 +109,7 @@ If you only want to use CSS Modules in some of your Vue components, you can use
109109
}
110110
]
111111
},
112-
// this matches plain <style> or <style scoped>
112+
// this matches plain `<style>` or `<style scoped>`
113113
{
114114
use: [
115115
'vue-style-loader',

docs/guide/extract-css.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module.exports = {
1818
// other options...
1919
module: {
2020
rules: [
21-
// ...other rules omitted
21+
// ... other rules omitted
2222
{
2323
test: /\.css$/,
2424
use: [
@@ -31,7 +31,7 @@ module.exports = {
3131
]
3232
},
3333
plugins: [
34-
// ...vue-loader plugin omitted
34+
// ... Vue Loader plugin omitted
3535
new MiniCssExtractPlugin({
3636
filename: style.css
3737
})
@@ -55,7 +55,7 @@ module.exports = {
5555
// other options...
5656
module: {
5757
rules: [
58-
// ...other rules omitted
58+
// ... other rules omitted
5959
{
6060
test: /\.css$/,
6161
loader: ExtractTextPlugin.extract({
@@ -66,7 +66,7 @@ module.exports = {
6666
]
6767
},
6868
plugins: [
69-
// ...vue-loader plugin omitted
69+
// ... Vue Loader plugin omitted
7070
new ExtractTextPlugin("style.css")
7171
]
7272
}

docs/guide/pre-processors.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ In your webpack config:
2020
module.exports = {
2121
module: {
2222
rules: [
23-
// ...other rules omitted
23+
// ... other rules omitted
2424

25-
// this will apply to both plain .scss files
26-
// AND <style lang="scss"> blocks in vue files
25+
// this will apply to both plain `.scss` files
26+
// AND `<style lang="scss">` blocks in `.vue` files
2727
{
2828
test: /\.scss$/,
2929
use: [
@@ -204,23 +204,23 @@ module.exports = {
204204
},
205205
module: {
206206
rules: [
207-
// ...other rules omitted
207+
// ... other rules omitted
208208
{
209209
test: /\.ts$/,
210210
loader: 'ts-loader',
211211
options: { appendTsSuffixTo: [/\.vue$/] }
212212
}
213213
]
214214
},
215-
// ...plugin omitted
215+
// ... plugin omitted
216216
}
217217
```
218218

219219
Configuration of TypeScipt can be done via `tsconfig.json`. Also see docs for [ts-loader](https://github.com/TypeStrong/ts-loader).
220220

221221
## Pug
222222

223-
Processing templates is a little different, because most webpack template loaders such as `pug-loader` return a template function instead of a compiled HTML string. Instead of using `pug-loader`, we need to use a loader that returns the raw HTML string instead, e.g. `pug-plain-loader`:
223+
Processing templates is a little different, because most webpack template loaders such as `pug-loader` return a template function instead of a compiled HTML string. Instead of using `pug-loader`, we need to use a loader that returns the raw HTML string, e.g. `pug-plain-loader`:
224224

225225
``` bash
226226
npm install -D pug pug-plain-loader
@@ -250,7 +250,7 @@ If you also intend to use it to import `.pug` files as HTML strings in JavaScrip
250250
{
251251
test: /\.pug$/,
252252
oneOf: [
253-
// this applies to <template lang="pug"> in Vue components
253+
// this applies to `<template lang="pug">` in Vue components
254254
{
255255
resourceQuery: /^\?vue/,
256256
use: ['pug-plain-loader']

docs/migrating.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ sidebarDepth: 2
66
# Migrating from v14
77

88
::: tip Heads Up
9-
We are in the process of upgrading Vue CLI 3 beta to use webpack 4 + Vue Loader 15, so you might want to wait if you are planning to upgrade to Vue CLI 3.
9+
We are in the process of upgrading Vue CLI 3 beta to use webpack 4 + Vue Loader v15, so you might want to wait if you are planning to upgrade to Vue CLI 3.
1010
:::
1111

1212
## Notable Breaking Changes
1313

1414
### A Plugin is Now Required
1515

16-
Vue Loader 15 now requires an accompanying webpack plugin to function properly:
16+
Vue Loader v15 now requires an accompanying webpack plugin to function properly:
1717

1818
``` js
1919
// webpack.config.js
@@ -29,7 +29,7 @@ module.exports = {
2929

3030
### Loader Inference
3131

32-
Vue Loader 15 now uses a different strategy to infer loaders to use for language blocks.
32+
Vue Loader v15 now uses a different strategy to infer loaders to use for language blocks.
3333

3434
Take `<style lang="less">` as an example: in v14 and below, it will attempt to load the block with `less-loader`, and implicitly chains `css-loader` and `vue-style-loader` after it, all using inline loader strings.
3535

@@ -39,7 +39,7 @@ In v15, `<style lang="less">` will behave as if it's an actual `*.less` file bei
3939
{
4040
module: {
4141
rules: [
42-
// ...other rules
42+
// ... other rules
4343
{
4444
test: /\.less$/,
4545
use: [
@@ -102,7 +102,7 @@ If you also intend to use it to import `.pug` files as HTML strings in JavaScrip
102102
{
103103
test: /\.pug$/,
104104
oneOf: [
105-
// this applies to <template lang="pug"> in Vue components
105+
// this applies to `<template lang="pug">` in Vue components
106106
{
107107
resourceQuery: /^\?vue/,
108108
use: ['pug-plain-loader']
@@ -158,13 +158,13 @@ The good news is that you can now configure `localIdentName` in one place:
158158
}
159159
```
160160

161-
If you only want to use CSS Modules in some of your Vue components, you can use a `oneOf` rule and check for the `module` string in resourceQuery:
161+
If you only want to use CSS Modules in some of your Vue components, you can use a `oneOf` rule and check for the `module` string in `resourceQuery`:
162162

163163
``` js
164164
{
165165
test: /\.css$/,
166166
oneOf: [
167-
// this matches <style module>
167+
// this matches `<style module>`
168168
{
169169
resourceQuery: /module/,
170170
use: [
@@ -178,7 +178,7 @@ If you only want to use CSS Modules in some of your Vue components, you can use
178178
}
179179
]
180180
},
181-
// this matches plain <style> or <style scoped>
181+
// this matches plain `<style>` or `<style scoped>`
182182
{
183183
use: [
184184
'vue-style-loader',
@@ -203,7 +203,7 @@ Works the same way as you'd configure it for normal CSS. Example usage with [min
203203
},
204204
{
205205
test: /\.css$/,
206-
// or ExtractTextWebpackPlugin.extract(...)
206+
// or `ExtractTextWebpackPlugin.extract(...)`
207207
use: [
208208
MiniCssExtractPlugin.loader,
209209
'css-loader'
@@ -230,7 +230,7 @@ externals: nodeExternals({
230230
})
231231
```
232232

233-
With v15, imports for `<style src="dep/foo.css">` now has resourceQuery strings appended at the end of the request, so you need to update the above to:
233+
With v15, imports for `<style src="dep/foo.css">` now has `resourceQuery` strings appended at the end of the request, so you need to update the above to:
234234

235235
``` js
236236
externals: nodeExternals({
@@ -261,7 +261,7 @@ The following option has been renamed:
261261

262262
- `transformToRequire` (now renamed to `transformAssetUrls`)
263263

264-
The following option has been changed to resourceQuery:
264+
The following option has been changed to `resourceQuery`:
265265

266266
- `shadowMode` (now use inline resource queries, e.g. `foo.vue?shadow`)
267267

docs/options.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ sidebar: auto
4343

4444
Configure ES2015+ to ES5 transpiling options for the generated render function code. The [transpiler](https://github.com/vuejs/vue-template-es2015-compiler) is a fork of [Buble](https://github.com/Rich-Harris/buble), so consult the available options [here](https://buble.surge.sh/guide/#using-the-javascript-api).
4545

46-
The template render functions compilation supports a special transform `stripWith` (enabled by default), which removes the `with` usage in generated render functions to make them strict-mode compliant. This is enabled by default.
46+
The template render functions compilation supports a special transform `stripWith` (enabled by default), which removes the `with` usage in generated render functions to make them strict-mode compliant.
4747

4848
## optimizeSSR
4949

0 commit comments

Comments
 (0)