• Sea.js入门


    Sea.js入门

    学习了:

    https://www.cnblogs.com/doseoer/p/4007752.html

    https://blog.csdn.net/love_is_all_in_life/article/details/50354367

    https://www.jianshu.com/p/ebdf2233e3fe  这个参考一下

    #930问题:https://github.com/seajs/seajs/issues/930

    ==================================================

    sea.js require路径的问题,

    文件结构:

    test01.html
    sea-modules/sea-debug.js
    static/test01.js
    static/changeText.js

    test01.html:

        <script src="sea-modules/sea-debug.js" ></script>
        <script>
            seajs.config({
                alias:{
                    'changeText':'./changeText.js'
                }
            });
            seajs.use('./static/test01.js')
        </script>

    test01.js:

    define(function (require, exports, module) {
        // var changeText = require('./changeText.js');
        var changeText = require('changeText');
        var title = document.getElementById('title');
        // title.innerHTML = 'aaa';
        title.innerHTML = changeText.init();
    });

    使用require命令的时候,路径是相对于引用文件test01.js的,而且必须以.或者..开头,如果不是以.或者..开头,就取sea-bug.js目录了;

    使用use命令的时候,路径是相对于html文件的;

    文件结构是:

    test01.html
    sea-modules/sea-debug.js
    static/hello/test01.js
    static/hello/changeText.js

    也是一样的,也是使用同样的require语句;

    文件结构是:

    test01.html
    sea-modules/seajs/seajs/2.2.0/sea-debug.js
    static/hello/test01.js
    static/hello/changeText.js

    也是一样的,也是使用同样的require语句;

    学习了:https://www.cnblogs.com/ada-zheng/p/3284660.html

    其中的data-config是html5引入的属性,被seajs使用了,在源码中可以看到;

  • 相关阅读:
    loadrunner上传文件到网盘
    robotframework + appium 获取android toast
    jmeter 签名MD5生成
    python appium 封装获取toast方法
    java appium客户端 6.1.0android长按及滑动变更
    父类与子类 构造函数 变量 加载顺序
    检测安卓手机联网方式
    context menu与submenu区别
    div 居中
    ndk的一些概念
  • 原文地址:https://www.cnblogs.com/stono/p/9021686.html
Copyright © 2020-2023  润新知