11 | 请在PC端使用Vular订制功能 12 |
13 |13 | This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information. 14 |
15 |17 | It uses utility classes for typography and spacing to space content out within the larger container. 18 |
19 | 20 | Learn more 21 | 22 |"+c()+"
"):e.insertContent(c())})},m=function(n){n.on("ResolveName",function(e){"IMG"===e.target.nodeName&&n.dom.hasClass(e.target,u())&&(e.name="pagebreak")})},s=function(e){e.ui.registry.addButton("pagebreak",{icon:"page-break",tooltip:"Page break",onAction:function(){return e.execCommand("mcePageBreak")}}),e.ui.registry.addMenuItem("pagebreak",{text:"Page break",icon:"page-break",onAction:function(){return e.execCommand("mcePageBreak")}})};!function l(){n.add("pagebreak",function(e){g(e),s(e),o(e),m(e)})}()}(); -------------------------------------------------------------------------------- /src/components/tinymce/dynamicLoadScript.js: -------------------------------------------------------------------------------- 1 | let callbacks = [] 2 | 3 | function loadedTinymce() { 4 | // to fixed https://github.com/PanJiaChen/vue-element-admin/issues/2144 5 | // check is successfully downloaded script 6 | return window.tinymce 7 | } 8 | 9 | const dynamicLoadScript = (src, callback) => { 10 | const existingScript = document.getElementById(src) 11 | const cb = callback || function() {} 12 | 13 | if (!existingScript) { 14 | const script = document.createElement('script') 15 | script.src = src // src url for the third-party library being loaded. 16 | script.id = src 17 | document.body.appendChild(script) 18 | callbacks.push(cb) 19 | const onEnd = 'onload' in script ? stdOnEnd : ieOnEnd 20 | onEnd(script) 21 | } 22 | 23 | if (existingScript && cb) { 24 | if (loadedTinymce()) { 25 | cb(null, existingScript) 26 | } else { 27 | callbacks.push(cb) 28 | } 29 | } 30 | 31 | function stdOnEnd(script) { 32 | script.onload = function() { 33 | // this.onload = null here is necessary 34 | // because even IE9 works not like others 35 | this.onerror = this.onload = null 36 | for (const cb of callbacks) { 37 | cb(null, script) 38 | } 39 | callbacks = null 40 | } 41 | script.onerror = function() { 42 | this.onerror = this.onload = null 43 | cb(new Error('Failed to load ' + src), script) 44 | } 45 | } 46 | 47 | function ieOnEnd(script) { 48 | script.onreadystatechange = function() { 49 | if (this.readyState !== 'complete' && this.readyState !== 'loaded') return 50 | this.onreadystatechange = null 51 | for (const cb of callbacks) { 52 | cb(null, script) // there is no way to catch loading errors in IE8 53 | } 54 | callbacks = null 55 | } 56 | } 57 | } 58 | 59 | export default dynamicLoadScript 60 | -------------------------------------------------------------------------------- /src/basic/vular-array.js: -------------------------------------------------------------------------------- 1 | export function first(array){ 2 | if(array.length > 0){ 3 | return array[0] 4 | } 5 | } 6 | 7 | export function last(array){ 8 | if(array.length > 0){ 9 | return array[array.length - 1] 10 | } 11 | } 12 | 13 | export function before(refence, array){ 14 | for(var i = 0; i < array.length; i++){ 15 | if(array[i] === refence && i > 0){ 16 | return array[i - 1]; 17 | } 18 | } 19 | } 20 | 21 | export function after(refence, array){ 22 | for(var i = 0; i < array.length; i++){ 23 | if(array[i] === refence && i < array.length){ 24 | return array[i + 1]; 25 | } 26 | } 27 | } 28 | 29 | 30 | export function insertBefore(child, refence, array){ 31 | for(var i = 0; i < array.length; i++){ 32 | if(array[i] === refence){ 33 | array.splice(i, 0, child) 34 | return; 35 | } 36 | } 37 | 38 | array.push(child) 39 | } 40 | 41 | export function insertAfter(child, refence, array){ 42 | for(var i = 0; i < array.length; i++){ 43 | if(array[i] === refence){ 44 | array.splice(i + 1, 0, child) 45 | return 46 | } 47 | } 48 | } 49 | 50 | export function remove(node, array){ 51 | for (var i = 0; i < array.length; i++) { 52 | if(array[i] === node){ 53 | array.splice(i, 1) 54 | break 55 | } 56 | } 57 | } 58 | 59 | export function add(node, array){ 60 | if(!contains(node, array)){ 61 | array.push(node) 62 | } 63 | } 64 | 65 | export function contains(node, array){ 66 | for (var i = 0; i < array.length; i++) { 67 | if(array[i] === node){ 68 | return true 69 | } 70 | } 71 | 72 | return false 73 | } 74 | 75 | export function tongleOnCondition(condition, node, array){ 76 | if(condition){ 77 | add(node, array) 78 | } 79 | else{ 80 | remove(node, array) 81 | } 82 | } 83 | 84 | export function clear(array){ 85 | array.length = 0 86 | } 87 | 88 | 89 | -------------------------------------------------------------------------------- /src/components/VularMediasPage.vue: -------------------------------------------------------------------------------- 1 | 2 |{{item.created_at}}
19 |