seaJs模块化APPCAN

 时间:2024-11-17 03:00:44

1、如果要将appcan基础JS文件模块化,将JS代码加上define(function(require, exports, module){return function(e){(function(appcan){。。。。。})(e)}})

2、config.js配置别名和路径seajs.config({ alias: { 'control': './../../js/appcan.control.js', 'main' : './main.js', 'uexLocation':'./../../plugin/uexLocation.js', }, paths:{ "root" : "./../../../", "module" : "./../module2/" }, map : []});

3、html页面先添加JS文件<script src="./js/appcan.js"></script> <script src="public/js/sea.js"></script>然后,将页面脚本也做一个模块化seajs.use("./public/js/config") define(function(require){ require("control")(appcan) appcan.ready(function() { var titHeight = $('#header').offset().height; appcan.frame.open("content", "index_content.html", 0, titHeight); window.onorientationchange = window.onresize = function() { appcan.frame.resize("content", 0, titHeight); } }); });注:主,子页面都要做此操作

  • APPCAN插件打包
  • APPCAN如何新建项目
  • APPCAN如何打包本地APP
  • APPCAN如何添加HTML文件
  • APPCAN中如何实现全局搜索
  • 热门搜索
    读书月手抄报 备战期中手抄报 安全健康快乐手抄报 关于感恩手抄报内容 梦想起航手抄报 珍惜时间手抄报 生活中的语文手抄报 儿童安全手抄报大全 环保的手抄报图片 关于森林防火的手抄报