codecamp

MorJS plugins - 插件配置

  • 类型: ​Plugin[]
  • 默认值: ​[]

配置 MorJS 插件, 详细参见如何开发 MorJS 插件

// 配置示例
{
plugins: [
[
'your_custom_mor_plugin',
{
/* 插件选项 */
}
],
// 或
'your_custom_mor_plugin',
// 或
{ name: 'plugin_name', apply(runner) {} },
// 或
new YourCustomMorJSPlugin()
]
}

// 自定义插件
class YourCustomMorJSPlugin {
name = 'YourCustomMorJSPlugin'
apply(runner) {
// plugin 逻辑
}
}


MorJS phantomDependency - 幽灵依赖检测
MorJS processNodeModules - 是否处理 node_modules
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

MorJS 指南

MorJS 基础用法

MorJS 配置

MorJS 编译相关配置

MorJS 进阶用法

MorJS Web开发

MorJS Web开发介绍

MorJS Web开发快速上手

MorJS Tabbar IOS 小黑条适配开关

MorJS 社区

MorJS 规范

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }