Vue 路由配置(导航守卫 + 白名单)

Vue Router Vue Router 是 Vue.js 官方的路由管理器。它和 Vue.js 的核心深度集成,让构建单页面应用变得易如反掌。包含的功能有: 嵌套的路由/视图表 模块化的、基于组件的路由配置 路由参数、查询、通配符 基于 Vue.js 过渡系统的视图过渡效果 细粒度的导航控制 带有自动激活的 CSS class 的链接 HTML5 历史模式或 hash 模式,...

发布于 Vue

el-table 中使用 switch 开关

需求说明 是根据后台返回 0(停用) 和 1(启用) 动态显示开关 对开关进行操作时请求后台,需要传两个参数:id,status 启用时传 1 停用时传 0 并携带 id ,当主机下面包含通道是则不能改变状态,并根据给出提示 套用1234567891011121314151617<el-table-column prop="status" label=&...

发布于 Vue

本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处。

本站由 @xiangshu 创建,使用 Stellar 作为主题。

ss.media = "only x"; function ready(cb) { if (doc.body) { return cb(); } setTimeout(function () { ready(cb); }); } ready(function () { ref.parentNode.insertBefore(ss, before ? ref : ref.nextSibling); }); var onloadcssdefined = function (cb) { var resolvedHref = ss.href; var i = sheets.length; while (i--) { if (sheets[i].href === resolvedHref) { return cb(); } } setTimeout(function () { onloadcssdefined(cb); }); }; function loadCB() { if (ss.addEventListener) { ss.removeEventListener("load", loadCB); } ss.media = media || "all"; } if (ss.addEventListener) { ss.addEventListener("load", loadCB); } ss.onloadcssdefined = onloadcssdefined; onloadcssdefined(loadCB); return ss; }, // 从 butterfly 和 volantis 获得灵感 loadScript: (src, opt) => new Promise((resolve, reject) => { var script = document.createElement('script'); script.src = src; if (opt) { for (let key of Object.keys(opt)) { script[key] = opt[key] } } else { // 默认异步,如果需要同步,第二个参数传入 {} 即可 script.async = true } script.onerror = reject script.onload = script.onreadystatechange = function() { const loadState = this.readyState if (loadState && loadState !== 'loaded' && loadState !== 'complete') return script.onload = script.onreadystatechange = null resolve() } document.head.appendChild(script) }), // https://github.com/jerryc127/hexo-theme-butterfly jQuery: (fn) => { if (typeof jQuery === 'undefined') { stellar.loadScript(stellar.plugins.jQuery).then(fn) } else { fn() } } }; stellar.github = 'https://github.com/xaoxuu/hexo-theme-stellar/tree/1.6.1'; stellar.config = { date_suffix: { just: '刚刚', min: '分钟前', hour: '小时前', day: '天前', month: '个月前', }, }; // required plugins (only load if needs) stellar.plugins = { jQuery: 'https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js', sitesjs: '/js/plugins/sites.js', friendsjs: '/js/plugins/friends.js', }; // optional plugins if ('true' == 'true') { stellar.plugins.lazyload = Object.assign({"enable":true,"js":"https://cdn.jsdelivr.net/npm/vanilla-lazyload@17.3.1/dist/lazyload.min.js","transition":"blur"}); } if ('true' == 'true') { stellar.plugins.swiper = Object.assign({"enable":true,"css":"https://unpkg.com/swiper@6/swiper-bundle.min.css","js":"https://unpkg.com/swiper@6/swiper-bundle.min.js"}); } if ('' == 'true') { stellar.plugins.scrollreveal = Object.assign({"enable":null,"js":"https://cdn.jsdelivr.net/npm/scrollreveal@4.0.9/dist/scrollreveal.min.js","distance":"8px","duration":500,"interval":100,"scale":1}); } if ('true' == 'true') { stellar.plugins.preload = Object.assign({"enable":true,"service":"flying_pages","instant_page":"https://cdn.jsdelivr.net/gh/volantis-x/cdn-volantis@4.1.2/js/instant_page.js","flying_pages":"https://cdn.jsdelivr.net/gh/gijo-varghese/flying-pages@2.1.2/flying-pages.min.js"}); } if ('true' == 'true') { stellar.plugins.fancybox = Object.assign({"enable":true,"js":"https://cdn.jsdelivr.net/npm/@fancyapps/ui@4.0/dist/fancybox.umd.js","css":"https://cdn.jsdelivr.net/npm/@fancyapps/ui@4.0/dist/fancybox.css","selector":".swiper-slide img"}); }