Giter Club home page Giter Club logo

Comments (14)

agragregra avatar agragregra commented on July 27, 2024

Очень странный у вас код, посмотрите внимательно. Вы пытаетесь импортировать jQuery из libs/slick.
jQuery следует подключать так:
import $ from 'jquery'; window.jQuery = $; window.$ = $
Slick следует подключать так:
npm i -D slick-carousel
В app.js:
import * as slick from 'slick-carousel'
В _config.sass импортах:
@import 'node_modules/slick-carousel/slick/slick.scss'

from optimizedhtml-5.

AntonLitvin avatar AntonLitvin commented on July 27, 2024

from optimizedhtml-5.

agragregra avatar agragregra commented on July 27, 2024

Попробуйте import из папки.

from optimizedhtml-5.

AntonLitvin avatar AntonLitvin commented on July 27, 2024

from optimizedhtml-5.

agragregra avatar agragregra commented on July 27, 2024

А import работает?

from optimizedhtml-5.

agragregra avatar agragregra commented on July 27, 2024

Всё, понял. Эта конструкция в стартере загружает из модулей jquery, погуглите как правильно из файла импортировать эту библиотеку.

from optimizedhtml-5.

AntonLitvin avatar AntonLitvin commented on July 27, 2024

from optimizedhtml-5.

agragregra avatar agragregra commented on July 27, 2024

Вам нужно чтобы и slick и jquery находились в файлах?

from optimizedhtml-5.

AntonLitvin avatar AntonLitvin commented on July 27, 2024

from optimizedhtml-5.

agragregra avatar agragregra commented on July 27, 2024

Вариант тут у меня вышел один. Устанавливать jQuery как модуль npm и импортировать его:
import $ from 'jquery'; window.jQuery = $; window.$ = $

А все старые плагины просто реквайрить ниже без константы или присвоения переменной:
require('../vendor/slick/slick.min.js')

Минифицированная версия jQuery не может работать полноценно в данном окружении. Так что можно использовать требуемую версию jQyery, прописав её в package.json или использовать всегда свежую из пакетов.

from optimizedhtml-5.

AntonLitvin avatar AntonLitvin commented on July 27, 2024

from optimizedhtml-5.

agragregra avatar agragregra commented on July 27, 2024

Вот, рабочий код у меня:

import $ from 'jquery'; window.jQuery = $; window.$ = $
require('../vendor/slick/slick.min.js')
$(".slider").slick()

from optimizedhtml-5.

AntonLitvin avatar AntonLitvin commented on July 27, 2024

from optimizedhtml-5.

agragregra avatar agragregra commented on July 27, 2024

jQuery следует подключать импортом из модулей. Или используйте стартер OH4, там всё по старому работает.

from optimizedhtml-5.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.