How to use the @egjs/flicking function in @egjs/flicking

To help you get started, we’ve selected a few @egjs/flicking examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github naver / egjs-flicking / packages / vue-flicking / src / Flicking.ts View on Github external
public mounted() {
    this.$_pluginsDiffer = new ListDiffer();
    this.$_cloneCount = 0;

    const options = {...this.options, ...{ renderExternal: true }};
    this.$_nativeFlicking = new NativeFlicking(
      this.$el as HTMLElement,
      {
        ...options,
        framework: "vue",
        frameworkVersion: Vue.version,
      } as object,
    );

    const slots = this.$_getSlots();
    this.$_slotDiffer = new ListDiffer(slots, vnode => vnode.key!);

    this.$_bindEvents();
    this.$_checkUpdate();

    if (this.options.renderOnlyVisible) {
      // Should update once to update visibles
github naver / egjs-flicking / packages / ngx-flicking / projects / ngx-flicking / src / lib / ngx-flicking.component.ts View on Github external
ngAfterViewInit() {
    if (!this.flicking) {
      this.flicking = new NativeFlicking(
        this.elRef.nativeElement.children[0],
        {
          ...this.options,
          framework: 'angular',
          frameworkVersion: VERSION.full,
        } as object,
      );
      this.userPanelDataDiffer = new ListDiffer(this.panels);

      this.syncPanelDataIfRenderOnlyVisible(this.panels);

      this.bindEvents();

      this.checkPlugins();

      setTimeout(() => {
github naver / egjs-flicking / packages / react-flicking / src / react-flicking / index.tsx View on Github external
public componentDidMount() {
    const options = {};
    const props = this.props;

    for (const name in props) {
      if (flickingOptions.indexOf(name as keyof IFlickingOptions) !== -1) {
        options[name] = props[name];
      }
    }

    this.flicking = new NativeFlicking(ReactDOM.findDOMNode(this) as HTMLElement, options);

    const flicking = this.flicking;

    flicking.on("flick", (e) => {
      this.props.onFlick(e);
    });
    flicking.on("flickEnd", (e) => {
      this.props.onFlickEnd(e);
    });
    flicking.on("beforeFlickStart", (e) => {
      this.props.onBeforeFlickStart(e);
    });
    flicking.on("beforeRestore", (e) => {
      this.props.onBeforeRestore(e);
    });
    flicking.on("restore", (e) => {
github naver / egjs-flicking / packages / react-flicking / src / react-flicking / Flicking.tsx View on Github external
public componentDidMount() {
    this.flicking = new NativeFlicking(
      findDOMNode(this) as HTMLElement,
      {
        ...this.options,
        framework: "react",
        frameworkVersion: React.version,
      } as object,
    ).on({
      moveStart: (e: FlickingEvent) => this.props.onMoveStart!(e),
      move: (e: FlickingEvent) => this.props.onMove!(e),
      moveEnd: (e: FlickingEvent) => this.props.onMoveEnd!(e),
      holdStart: (e: FlickingEvent) => this.props.onHoldStart!(e),
      holdEnd: (e: FlickingEvent) => this.props.onHoldEnd!(e),
      select: (e: FlickingEvent) => this.props.onSelect!(e),
      needPanel: (e: NeedPanelEvent) => this.props.onNeedPanel!(e),
      change: (e: FlickingEvent) => this.props.onChange!(e),
      restore: (e: FlickingEvent) => this.props.onRestore!(e),