Socket
Socket
Sign inDemoInstall

test33

Package Overview
Dependencies
1
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    test33


Version published
Weekly downloads
2
Maintainers
1
Install size
7.35 MB
Created
Weekly downloads
 

Readme

Source

初始化页面(Page)

var app = new xf.Page();
  • type:Page
  • todo:
    1. 初始化视图编号和历史
    2. 监听后退事件
    3. 配置requirejs

进入/替换到视图

app.go(name, para, opt);
app.goset(name, para, opt);
  • type:View
  • args:
    • name [string]: 视图名称
    • para [object]: 传递给视图模块的参数
    • opt [object]: 视图配置
  • todo:
    1. 维护视图
    2. 维护历史
    3. 打开页

打开视图

app.open(name, para, opt);
  • type/args:同上
  • context
    • page [Page]: 页面对象
  • todo:
    1. 创建视图
    2. 载入视图模块

创建视图

var view = new View(opt, page);
  • type:View
  • args:
    • opt [object]: 视图容器配置
    • page [Page]: 页面对象
  • context
    • page [Page]: 页面对象
    • view [View]: 视图对象
  • todo:
    1. 创建并挂载容器元素
    2. 监听容器缩放
    3. 设置容器焦点

载入视图内容

view.load(url, para);
  • type: View
  • args:
    • url: 要载入的地址
    • para:传递到视图的参数
  • context
    • para [object]: 传递到视图的参数
  • todo:
    1. 通过url分析所需资源
    2. 载入资源
    3. 解析执行模块
    4. 开始构建

解析执行模块

xf.module(para);
  • args:
    • target: 模块配置
  • context:
    • name: 包名
  • todo:
    1. 载入using里的依赖资源
    2. 向context中加入包名
    3. 返回方法

构建内容资源

t._buildSource(builder, html)
  • type:
    • builder [function]: 构建器
    • html [string]:模板代码
  • context
    • html [string]:模板代码
  • todo
    • 替换模板里的代码片段
    • 模板放入context
    • 调用开始构建

开始构建

builder(t.context);
  • 参数
    • t.context:上下文
  • context
    • modal [View]: 视图本身
    • el [Element]: 内容元素
  • todo
    1. 在context中放入modal和el
    2. 创建容器内的根元素并挂载
    3. 自定义的初始化

构建完成

context.view.ready(context)
  • 参数
    • context: 上下文
  • context
    • html(delete): 删除模板

FAQs

Last updated on 09 May 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc