Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Element
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
林焕东
Element
Commits
ce8c8692
Commit
ce8c8692
authored
Feb 28, 2017
by
cinwell.li
Committed by
baiyaaaaa
Feb 28, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support vue 2.2 (#3097)
parent
46fc121c
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
12 deletions
+28
-12
packages/scrollbar/src/main.js
packages/scrollbar/src/main.js
+2
-2
packages/scrollbar/src/util.js
packages/scrollbar/src/util.js
+0
-4
src/locale/format.js
src/locale/format.js
+3
-4
src/utils/util.js
src/utils/util.js
+21
-0
src/utils/vdom.js
src/utils/vdom.js
+2
-2
No files found.
packages/scrollbar/src/main.js
View file @
ce8c8692
...
...
@@ -2,7 +2,7 @@
import
{
addResizeListener
,
removeResizeListener
}
from
'
element-ui/src/utils/resize-event
'
;
import
scrollbarWidth
from
'
element-ui/src/utils/scrollbar-width
'
;
import
*
as
util
from
'
.
/util
'
;
import
{
toObject
}
from
'
element-ui/src/utils
/util
'
;
import
Bar
from
'
./bar
'
;
/* istanbul ignore next */
...
...
@@ -48,7 +48,7 @@ export default {
const
gutterStyle
=
`margin-bottom:
${
gutterWith
}
; margin-right:
${
gutterWith
}
;`
;
if
(
Array
.
isArray
(
this
.
wrapStyle
))
{
style
=
util
.
toObject
(
this
.
wrapStyle
);
style
=
toObject
(
this
.
wrapStyle
);
style
.
marginRight
=
style
.
marginBottom
=
gutterWith
;
}
else
if
(
typeof
this
.
wrapStyle
===
'
string
'
)
{
style
+=
gutterStyle
;
...
...
packages/scrollbar/src/util.js
View file @
ce8c8692
import
Vue
from
'
vue
'
;
export
const
BAR_MAP
=
{
vertical
:
{
offset
:
'
offsetHeight
'
,
...
...
@@ -34,5 +32,3 @@ export function renderThumbStyle({ move, size, bar }) {
return
style
;
};
export
const
toObject
=
Vue
.
util
.
toObject
;
src/locale/format.js
View file @
ce8c8692
import
{
hasOwn
}
from
'
element-ui/src/utils/util
'
;
const
RE_NARGS
=
/
(
%|
)\{([
0-9a-zA-Z_
]
+
)\}
/g
;
/**
* String format template
* - Inspired:
* https://github.com/Matt-Esch/string-template/index.js
*/
const
RE_NARGS
=
/
(
%|
)\{([
0-9a-zA-Z_
]
+
)\}
/g
;
export
default
function
(
Vue
)
{
const
{
hasOwn
}
=
Vue
.
util
;
/**
* template
...
...
src/utils/util.js
0 → 100644
View file @
ce8c8692
const
hasOwnProperty
=
Object
.
prototype
.
hasOwnProperty
;
export
function
hasOwn
(
obj
,
key
)
{
return
hasOwnProperty
.
call
(
obj
,
key
);
};
function
extend
(
to
,
_from
)
{
for
(
let
key
in
_from
)
{
to
[
key
]
=
_from
[
key
];
}
return
to
;
};
export
function
toObject
(
arr
)
{
var
res
=
{};
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
if
(
arr
[
i
])
{
extend
(
res
,
arr
[
i
]);
}
}
return
res
;
};
src/utils/vdom.js
View file @
ce8c8692
import
Vue
from
'
vue
'
;
import
{
hasOwn
}
from
'
element-ui/src/utils/util
'
;
export
function
isVNode
(
node
)
{
return
typeof
node
===
'
object
'
&&
Vue
.
util
.
hasOwn
(
node
,
'
componentOptions
'
);
return
typeof
node
===
'
object
'
&&
hasOwn
(
node
,
'
componentOptions
'
);
};
export
function
getFirstComponentChild
(
children
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment