Giter Site home page Giter Site logo

模块加载问题 about buijs-cli HOT 4 CLOSED

imouou avatar imouou commented on May 27, 2024
模块加载问题

from buijs-cli.

Comments (4)

qq702482502 avatar qq702482502 commented on May 27, 2024

loader.require(["pages/main/home"],function (mod) {
// 有回调的话是每次切换都会触发
mod.init();
})

from buijs-cli.

imouou avatar imouou commented on May 27, 2024

router.loadPart 是用于局部加载模板,如果有脚本会顺带执行, 相当于 router.load , 只是一个是在当前页的某个id里,一个是新开页面;
loader.require 是加载某个模块, 默认没有回调的话是会缓存, 也就是继续 require, 不会重新请求, 当你有回调的时候, 每次都会执行这个回调, 而这个回调可以拿到你加载模块的上下文的方法, 也就是你的home要return 出 一个init 方法才会有.

这个路由及模块可以实现很多复杂的组合及需求. 具体可以下载案例理解

from buijs-cli.

qq702482502 avatar qq702482502 commented on May 27, 2024

有供交流的群吗?

from buijs-cli.

imouou avatar imouou commented on May 27, 2024

具体查看官网的文档吧 www.easybui.com

from buijs-cli.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.