mirror of
https://github.com/201206030/novel-plus.git
synced 2025-04-27 01:30:51 +00:00
24 lines
642 B
Java
24 lines
642 B
Java
import polyfill from './util/poly-fill.js'
|
|
import Editor from './editor/index.js'
|
|
|
|
// 检验是否浏览器环境
|
|
try {
|
|
document
|
|
} catch (ex) {
|
|
throw new Error('请在浏览器环境下运行')
|
|
}
|
|
|
|
// polyfill
|
|
polyfill()
|
|
|
|
// 这里的 `inlinecss` 将被替换成 css 代码的内容,详情可去 ./gulpfile.js 中搜索 `inlinecss` 关键字
|
|
const inlinecss = '__INLINE_CSS__'
|
|
|
|
// 将 css 代码添加到 <style> 中
|
|
let style = document.createElement('style')
|
|
style.type = 'text/css'
|
|
style.innerHTML= inlinecss
|
|
document.getElementsByTagName('HEAD').item(0).appendChild(style)
|
|
|
|
// 返回
|
|
export default (window.wangEditor || Editor) |