Git Product home page Git Product logo

Comments (8)

Morgul avatar Morgul commented on July 28, 2024

Do you have jQuery being loaded before using alert? If you just started with vue-cli, I'm guessing that's missing (it's a dependency of VueBoot, not Vue in general).

Try adding jQuery to you project first, and make sure in the console you can type $ and get:

> $
function ( selector, context ) {
        // The jQuery object is actually just the init constructor 'enhanced'
        return new jQuery.fn.init( selector, context, rootjQuery );
    }

from vueboot.

schlitzered avatar schlitzered commented on July 28, 2024

thanks for the answer, it seems taht jquery is indeed not loaded, i added it to package.json, but calling "$" in the console, but it only gives back "function()"

i tired to google it, but have not been able to find out how i should load jquery with vue. could you please give me a hint?

from vueboot.

Morgul avatar Morgul commented on July 28, 2024

Sure. :)

Loading jquery has nothing to do with vue, which is why you're struggling. Instead, you would need to figure out how to correctly configure Webpack. I'm not super familiar with Webpack (I've never used it), but I'd head in that direction.

Once you figure out jQuery, Bootstrap also requires tether, so you'll need to do the same thing for it.

For now, I'd recommend just putting these two lines in your body tag, and see if everything else just works:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.3.1/js/tether.min.js"></script>

If it does, then you can work on figuring out how to make webpack expose jquery and tether as globals for Bootstrap's js to pick up on. (They have to be globals, currently, due to how Bootstrap v4's javascript is written, unfortunately.)

from vueboot.

Morgul avatar Morgul commented on July 28, 2024

Btw, I recommend taking a look at the examples:

https://github.com/Morgul/vueboot/blob/master/examples/alert.html

from vueboot.

schlitzered avatar schlitzered commented on July 28, 2024

thank for your input, i managed to get jquery & tether globally available via webpack,

but now i get the following error, after the 4 seconds timeout:

TypeError: $(...).alert is not a function

from vueboot.

Morgul avatar Morgul commented on July 28, 2024

Ah, you aren't including the Bootstrap v4 javascript.

from vueboot.

schlitzered avatar schlitzered commented on July 28, 2024

arg! yes, that did the trick. thank you so much for your help, i am a total newbie when it comes to web developement and all this css, html, javascript stuff \o/

this ticket can get closed now

from vueboot.

Morgul avatar Morgul commented on July 28, 2024

No problem! We all have to start somewhere. :)

from vueboot.

Related Issues (8)

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.