alpine-collective / alpine-magic-helpers

A collection of magic properties and helper functions for use with Alpine.js
https://npmjs.com/alpine-magic-helpers
MIT License
747 stars 19 forks source link

scroll not working in alpine.js v3 #157

Closed Shadecute closed 3 years ago

Shadecute commented 3 years ago

Hello, I am new to livewire/alpine and trying to use alpine-magic-helpers Scroll i want use apline.js lasted version <script defer src="https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js"></script> not working and show me this error in console VM8167:3 Uncaught (in promise) ReferenceError: $scroll is not defined at eval (eval at qr (cdn.min.js:1), <anonymous>:3:16) at cdn.min.js:1 at Br (cdn.min.js:1) at cdn.min.js:5 at o (cdn.min.js:5) at cdn.min.js:5 at HTMLButtonElement.<anonymous> (cdn.min.js:5)

SimoTod commented 3 years ago

This repo is for v2 (see readme: https://github.com/alpine-collective/alpine-magic-helpers#magic-helpers)

There is a work in progress for v3, $scroll is already available, add <script src="https://unpkg.com/@alpine-collective/toolkit-scroll@1.0.0/dist/cdn.min.js" defer></script> before Alpine