neosrulez/locomotivescroll

此包最新版本(1.0.1)没有可用的许可证信息。

Neos CMS 包用于使用 Locomotive Scroll (https://locomotivemtl.github.io/locomotive-scroll/)

安装: 43

依赖: 0

建议: 0

安全: 0

星标: 0

关注者: 2

分支: 0

公开问题: 0

语言:SCSS

类型:neos-package

1.0.1 2021-10-15 06:22 UTC

This package is not auto-updated.

Last update: 2024-09-27 20:07:52 UTC


README

一个用于在 Neos 中使用 Locomotive Scroll (https://locomotivemtl.github.io/locomotive-scroll/) 的包。

安装

NeosRulez.LocomotiveScroll 包已列在 packagist (https://packagist.org.cn/packages/neosrulez/locomotivescroll) 上 - 因此您不再需要将其包含在 "repositories" 条目中。

只需运行

composer require neosrulez/locomotivescroll

配置

这里的所有设置: https://github.com/locomotivemtl/locomotive-scroll 中的设置都可以使用

NeosRulez:
  LocomotiveScroll:
    settings:
      smooth: true
      reloadOnContextChange: true
      scrollFromAnywhere: true

节点类型混入

将混入添加到您的内容超级类型的 superTypes 中

'Acme.Site:Component.AbstractContent':
  superTypes:
    'Neos.Neos:Content': true
    'NeosRulez.LocomotiveScroll:Mixin.LocomotiveScroll': true

Fusion 组件

您只需将 Locomotive Wrapper 包装在 AbstractContent 上

prototype(Acme.Site:Component.AbstractContent) {
    
    renderer = afx`
        <NeosRulez.LocomotiveScroll:Wrapper>
            {props.content}
        </NeosRulez.LocomotiveScroll:Wrapper>
    `
}

或者这样使用

prototype(Acme.Site:Component.Foo) {
    
    renderer = afx`
        <NeosRulez.LocomotiveScroll:Wrapper isScrollable="true" dataScrollSpeed="1" direction="horizontal">
            <p>My awesome component</p>
        </NeosRulez.LocomotiveScroll:Wrapper>
    `
}

作者