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
f073a087
Commit
f073a087
authored
Oct 04, 2017
by
Leopoldthecoder
Committed by
杨奕
Oct 04, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix docs theme switch bug
parent
88811bd1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
examples/components/theme-picker.vue
examples/components/theme-picker.vue
+5
-4
No files found.
examples/components/theme-picker.vue
View file @
f073a087
...
@@ -58,7 +58,8 @@
...
@@ -58,7 +58,8 @@
const
docsHandler
=
getHandler
(
this
.
docs
,
'
docs-style
'
);
const
docsHandler
=
getHandler
(
this
.
docs
,
'
docs-style
'
);
if
(
!
this
.
chalk
)
{
if
(
!
this
.
chalk
)
{
this
.
getCSSString
(
`https://unpkg.com/element-ui@
${
version
}
/lib/theme-chalk/index.css`
,
chalkHandler
);
const
url
=
`https://unpkg.com/element-ui@
${
version
}
/lib/theme-chalk/index.css`
;
this
.
getCSSString
(
url
,
chalkHandler
,
'
chalk
'
);
}
else
{
}
else
{
chalkHandler
();
chalkHandler
();
}
}
...
@@ -67,7 +68,7 @@
...
@@ -67,7 +68,7 @@
const
links
=
[].
filter
.
call
(
document
.
querySelectorAll
(
'
link
'
),
link
=>
{
const
links
=
[].
filter
.
call
(
document
.
querySelectorAll
(
'
link
'
),
link
=>
{
return
/docs
\.
.+
\.
css/
.
test
(
link
.
href
||
''
);
return
/docs
\.
.+
\.
css/
.
test
(
link
.
href
||
''
);
});
});
links
[
0
]
&&
this
.
getCSSString
(
links
[
0
].
href
,
docsHandler
);
links
[
0
]
&&
this
.
getCSSString
(
links
[
0
].
href
,
docsHandler
,
'
docs
'
);
}
else
{
}
else
{
docsHandler
();
docsHandler
();
}
}
...
@@ -94,11 +95,11 @@
...
@@ -94,11 +95,11 @@
return
newStyle
;
return
newStyle
;
},
},
getCSSString
(
url
,
callback
)
{
getCSSString
(
url
,
callback
,
variable
)
{
const
xhr
=
new
XMLHttpRequest
();
const
xhr
=
new
XMLHttpRequest
();
xhr
.
onreadystatechange
=
()
=>
{
xhr
.
onreadystatechange
=
()
=>
{
if
(
xhr
.
readyState
===
4
&&
xhr
.
status
===
200
)
{
if
(
xhr
.
readyState
===
4
&&
xhr
.
status
===
200
)
{
this
.
chalk
=
xhr
.
responseText
.
replace
(
/@font-face{
[^
}
]
+}/
,
''
);
this
[
variable
]
=
xhr
.
responseText
.
replace
(
/@font-face{
[^
}
]
+}/
,
''
);
callback
();
callback
();
}
}
};
};
...
...
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