Skip to content

Commit c4f6cfe

Browse files
committed
chore: change attrs to attributes
1 parent 0318207 commit c4f6cfe

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This is a fork based on [style-loader](https://github.com/webpack/style-loader).
88

99
Type: `boolean`. When importing the style from a non-vue-file, by default the style is injected as a side effect of the import. When `manualInject` is true, the imported style object exposes a `__inject__` method, which can then be called manually at appropriate timing. If called on the server, the method expects one argument which is the `ssrContext` to attach styles to.
1010

11-
``` js
11+
```js
1212
import styles from 'styles.scss'
1313

1414
export default {
@@ -30,7 +30,7 @@ This is a fork based on [style-loader](https://github.com/webpack/style-loader).
3030

3131
Type: `boolean`. Add `data-vue-ssr-id` attribute to injected `<style>` tags even when not in Node.js. This can be used with pre-rendering (instead of SSR) to avoid duplicate style injection on hydration.
3232

33-
- **attrs** (4.0.1+):
33+
- **attributes** (4.0.1+):
3434

3535
Type: `object`. Add custom attribute to injected `<style>` tags.
3636

Diff for: lib/addStylesClient.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default function addStylesClient (parentId, list, _isProduction, _options
5353
isProduction = _isProduction
5454

5555
options = _options || {}
56-
options.attrs = typeof options.attrs === "object" ? options.attrs : {}
56+
options.attributes = typeof options.attributes === "object" ? options.attributes : {}
5757

5858
var styles = listToStyles(parentId, list)
5959
addStylesToDom(styles, options)
@@ -112,14 +112,14 @@ function addStylesToDom (styles /* Array<StyleObject> */, options) {
112112
function createStyleElement (options) {
113113
var styleElement = document.createElement('style')
114114
styleElement.type = 'text/css'
115-
addAttrs(styleElement, options.attrs);
115+
addAttributes(styleElement, options.attributes);
116116
head.appendChild(styleElement)
117117
return styleElement
118118
}
119119

120-
function addAttrs (el, attrs) {
121-
Object.keys(attrs).forEach(function (key) {
122-
el.setAttribute(key, attrs[key]);
120+
function addAttributes (el, attributes) {
121+
Object.keys(attributes).forEach(function (key) {
122+
el.setAttribute(key, attributes[key]);
123123
});
124124
}
125125

0 commit comments

Comments
 (0)