window.alert = function (obj) {
	var iframe = document.createElement('iframe');
	iframe.src = 'javascript:void(0);'
	document.body.appendChild(iframe)
	iframe.contentWindow.alert(obj);
	iframe.parentNode.removeChild(iframe);
}

window.hugo={}
window.hugo.iframes=[]
let iframes=window.hugo.iframes;
var openIframe=function(html,body){
	// 1. 创建<iframe>元素
	var ifr = document.createElement('iframe');
//	// 2. 将CSS,HTML字符串转换为Blob对象
//	var blob = new Blob([html], {
//	  'type': 'text/html'
//	});
//	// 3. 使用URL.createObjectURL()方法将...
//	iframe.src = URL.createObjectURL(blob);
	body.innerHTML = "";
	body.appendChild(ifr);
	var ifrw = (ifr.contentWindow) ? ifr.contentWindow: (ifr.contentDocument.document) ? ifr.contentDocument.document: ifr.contentDocument;
	ifrw.document.open();
	ifrw.document.write(html);
	ifrw.document.close();
	//console.log(x)
}
//开启页面html
{

    let xx = $("#cnblogs_post_body,.cnblogs-post-body").find("[data-type=html]");
    let xxx = [];
    for (let x of xx) {
        xxx.push(x.innerText)
    };
    xx.remove();
    let URL = window.URL || window.webkitURL;
    for (let x of xxx) {
		//openIframe(x,document.body)
		iframes.push(x);
    };
}

随笔分类 -  vue学习之路

摘要:修改 src/index.ejs 把 <% if (!process.browser) { %> <script> if (process.env.NODE_ENV !== 'development') window.__static = require('path').join(__dirname 阅读全文
posted @ 2020-07-27 19:19 离线云 阅读(603) 评论(0) 推荐(0)
摘要:npm淘宝源 npm config set registry=https://registry.npm.taobao.orgnpm config set sass_binary_site=https://npm.taobao.org/mirrors/node-sass/npm config set 阅读全文
posted @ 2020-07-27 19:08 离线云 阅读(5293) 评论(0) 推荐(0)
摘要:使用cube-ui时鼠标滚轮无法使用,且老触发无法滑动的bug,我十分困惑,于是分析了scroll组件,发现better-scroll才是关键. 于是我赶紧看了看better-scroll的文档.发现鼠标滚轮是可以开启的.开启之后终于可以愉快的使用鼠标滚轮了. 使用better-scroll,在ch 阅读全文
posted @ 2019-08-28 00:16 离线云 阅读(3007) 评论(1) 推荐(0)
摘要:直接在web端新建应用 C:\Users\Hugo> vue ui 直接在web端新建应用 C:\Users\Hugo> vue ui 阅读全文
posted @ 2018-12-09 19:58 离线云 阅读(437) 评论(0) 推荐(0)
摘要:安装Node.js和npm 首先,从Node.js官网下载对应平台的安装程序,在Windows上安装时务必选择全部组件,包括勾选Add to Path,npm已经在Node.js安装的时候顺带装好了. C:\Users\Hugo>node -v v10.14.1 C:\Users\Hugo>npm 阅读全文
posted @ 2018-12-09 19:42 离线云 阅读(208) 评论(0) 推荐(0)