Skip to content
Open
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
3 changes: 2 additions & 1 deletion src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,13 @@ function getBestSelectionFromSrcset (el, scale) {
const result = []
const container = el.parentNode
const containerWidth = container.offsetWidth * scale
const splitArg = options.includes(',\n') ? ',\n' : ', '
Copy link

@hsxfjames hsxfjames Nov 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should splitArg be /,\s+/ ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried with /,\s+/ and ain't working. With the ,\n works fine.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the /,\s+/ does not work? /,\n/ is not very suitable.


let spaceIndex
let tmpSrc
let tmpWidth

options = options.trim().split(',')
options = options.trim().split(splitArg)

options.map(item => {
item = item.trim()
Expand Down
3 changes: 2 additions & 1 deletion vue-lazyload.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,12 +375,13 @@ function getBestSelectionFromSrcset(el, scale) {
var result = [];
var container = el.parentNode;
var containerWidth = container.offsetWidth * scale;
var splitArg = options.includes(',\n') ? ',\n' : ', ';

var spaceIndex = void 0;
var tmpSrc = void 0;
var tmpWidth = void 0;

options = options.trim().split(',');
options = options.trim().split(splitArg);

options.map(function (item) {
item = item.trim();
Expand Down
Loading