定制 wubinworks/module-require-css 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

wubinworks/module-require-css

最新稳定版本:1.0.0

Composer 安装命令:

composer require wubinworks/module-require-css

包简介

An extremely simple module that enables Magento 2's ability to use Require Css.

README 文档

README

An extremely simple module that enables Magento 2's ability to use Require Css.
(This module is designed as a dependency for making other modules.)

  • Very useful when you need to load css in .phtml.
  • Dynamically load css.
  • Use inside <head>(eg: load different external css for different stores).

Usage

<script>
// Load a single css in
// [module root]/view/[area]/web/css/example-01.css
// or
// [theme root]/web/css/example-01.css
require(['require-css!css/example-01']);

// Load multiple css.
require([
    'require-css!css/example-02',
    'require-css!css/example-03'
], function () {
    // Code to run when all css loaded successfully.
});

// Load external css. You don't need the .css extension.
require(['require-css!https://some-cdn.tld/styles']);
</script>

How it works

The core part, which is a RequireJS Plugin, is taken from here. When the dependency require-css!css/styles is required, it will inject a link element that contains stylesheet into <head>.

Best used with

wubinworks/HeadContent

Requirements

Magento 2

Installation

composer require wubinworks/module-require-css
Don't forget to run php bin/magento setup:upgrade

统计信息

  • 总下载量: 6
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: JavaScript

其他信息

  • 授权协议: OSL-3.0
  • 更新时间: 2023-10-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固