Socket
Book a DemoInstallSign in
Socket

egg-renderx

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

egg-renderx

egg 视图自适应PC和移动端

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

egg 视图扩展

plugin.js中配置

exports.renderx = {
  enable: true,
  package: 'egg-renderx'
};

渲染视图

await this.ctx.renderX(name, locals, options);

规则说明

以index的njk视图为例:

  • 文件名

    • PC端:index.njk
    • 移动端:index.h5.njk
  • 适配

    • PC访问:index.njk
    • 移动端访问:index.h5.njk
  • 仅有一个index.njk时适配

    • PC访问:index.njk
    • 移动端访问:index.njk
  • 仅有一个index.h5.njk时适配

    • PC访问:抛异常
    • 移动端访问:index.h5.njk
  • 总结:无论是否需要适配移动端,都需要有一个index.njk

Keywords

egg

FAQs

Package last updated on 18 Mar 2020

Did you know?

Socket

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.