forked from qianyinghuanmie/vue2.0-demos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
20523dc
commit c435fb9
Showing
9 changed files
with
216 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
;(function(window) { | ||
|
||
var svgSprite = '<svg>' + | ||
'' + | ||
'<symbol id="icon-back" viewBox="0 0 1024 1024">' + | ||
'' + | ||
'<path d="M363.840919 472.978737C336.938714 497.358861 337.301807 537.486138 364.730379 561.486138L673.951902 832.05497C682.818816 839.813519 696.296418 838.915012 704.05497 830.048098 711.813519 821.181184 710.915012 807.703582 702.048098 799.94503L392.826577 529.376198C384.59578 522.174253 384.502227 511.835287 392.492414 504.59418L702.325747 223.807723C711.056111 215.895829 711.719614 202.404616 703.807723 193.674252 695.895829 184.943889 682.404617 184.280386 673.674253 192.192278L363.840919 472.978737Z" ></path>' + | ||
'' + | ||
'</symbol>' + | ||
'' + | ||
'<symbol id="icon-more" viewBox="0 0 1024 1024">' + | ||
'' + | ||
'<path d="M642.174253 504.59418C650.164439 511.835287 650.070886 522.174253 641.84009 529.376198L332.618569 799.94503C323.751654 807.703582 322.853148 821.181184 330.611697 830.048098 338.370249 838.915012 351.847851 839.813519 360.714765 832.05497L669.936288 561.486138C697.36486 537.486138 697.727953 497.358861 670.825747 472.978737L360.992414 192.192278C352.26205 184.280386 338.770837 184.943889 330.858944 193.674252 322.947053 202.404616 323.610556 215.895829 332.340919 223.807723L642.174253 504.59418Z" ></path>' + | ||
'' + | ||
'</symbol>' + | ||
'' + | ||
'</svg>' | ||
var script = function() { | ||
var scripts = document.getElementsByTagName('script') | ||
return scripts[scripts.length - 1] | ||
}() | ||
var shouldInjectCss = script.getAttribute("data-injectcss") | ||
|
||
/** | ||
* document ready | ||
*/ | ||
var ready = function(fn) { | ||
if (document.addEventListener) { | ||
if (~["complete", "loaded", "interactive"].indexOf(document.readyState)) { | ||
setTimeout(fn, 0) | ||
} else { | ||
var loadFn = function() { | ||
document.removeEventListener("DOMContentLoaded", loadFn, false) | ||
fn() | ||
} | ||
document.addEventListener("DOMContentLoaded", loadFn, false) | ||
} | ||
} else if (document.attachEvent) { | ||
IEContentLoaded(window, fn) | ||
} | ||
|
||
function IEContentLoaded(w, fn) { | ||
var d = w.document, | ||
done = false, | ||
// only fire once | ||
init = function() { | ||
if (!done) { | ||
done = true | ||
fn() | ||
} | ||
} | ||
// polling for no errors | ||
var polling = function() { | ||
try { | ||
// throws errors until after ondocumentready | ||
d.documentElement.doScroll('left') | ||
} catch (e) { | ||
setTimeout(polling, 50) | ||
return | ||
} | ||
// no errors, fire | ||
|
||
init() | ||
}; | ||
|
||
polling() | ||
// trying to always fire before onload | ||
d.onreadystatechange = function() { | ||
if (d.readyState == 'complete') { | ||
d.onreadystatechange = null | ||
init() | ||
} | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* Insert el before target | ||
* | ||
* @param {Element} el | ||
* @param {Element} target | ||
*/ | ||
|
||
var before = function(el, target) { | ||
target.parentNode.insertBefore(el, target) | ||
} | ||
|
||
/** | ||
* Prepend el to target | ||
* | ||
* @param {Element} el | ||
* @param {Element} target | ||
*/ | ||
|
||
var prepend = function(el, target) { | ||
if (target.firstChild) { | ||
before(el, target.firstChild) | ||
} else { | ||
target.appendChild(el) | ||
} | ||
} | ||
|
||
function appendSvg() { | ||
var div, svg | ||
|
||
div = document.createElement('div') | ||
div.innerHTML = svgSprite | ||
svgSprite = null | ||
svg = div.getElementsByTagName('svg')[0] | ||
if (svg) { | ||
svg.setAttribute('aria-hidden', 'true') | ||
svg.style.position = 'absolute' | ||
svg.style.width = 0 | ||
svg.style.height = 0 | ||
svg.style.overflow = 'hidden' | ||
prepend(svg, document.body) | ||
} | ||
} | ||
|
||
if (shouldInjectCss && !window.__iconfont__svg__cssinject__) { | ||
window.__iconfont__svg__cssinject__ = true | ||
try { | ||
document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>"); | ||
} catch (e) { | ||
console && console.log(e) | ||
} | ||
} | ||
|
||
ready(appendSvg) | ||
|
||
|
||
})(window) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.