2

I've included laravel app.js in order to use Vue but now my Twitter Bootstrap dropdowns are not working.

<script type="text/javascript" src="{!! asset('js/app.js') !!}"></script>
    <script type="text/javascript" src="{!! asset('assets/js/core/libraries/jquery.min.js') !!}"></script>
    <script type="text/javascript" src="{!! asset('assets/js/core/libraries/bootstrap.min.js') !!}"></script>
    <script type="text/javascript" src="{!! asset('assets/js/plugins/loaders/pace.min.js') !!}"></script>
    <script type="text/javascript" src="{!! asset('assets/js/plugins/loaders/blockui.min.js') !!}"></script>
    <script type="text/javascript" src="{!! asset('assets/js/plugins/ui/nicescroll.min.js') !!}"></script>
    <script type="text/javascript" src="{!! asset('assets/js/plugins/ui/drilldown.js') !!}"></script>

    <script type="text/javascript" src="{!! asset('assets/js/core/app.js') !!}"></script>

As soon as I remove the first script (Laravel's app.js) dropdowns are working fine again.

2
  • 1
    your question is not quite clear. are you using bootstrap for dropdown or you're using vue to populate dropdown? Commented Apr 23, 2017 at 11:33
  • @imrealashu I'm using bootstrap for dropdown. Now I want to use Vue to create component not related in any way to dropdown but as soon as I included app.js bootstrap's dropdowns stopped working Commented Apr 23, 2017 at 11:35

1 Answer 1

3

Laravel's default npm package already includes Twitter Bootstrap javascript. Now you're executing the same code twice, which may cause errors and break your dropdown, but also all other javascript on your page.

Sign up to request clarification or add additional context in comments.

3 Comments

You'r right ! After removing <script type="text/javascript" src="{!! asset('assets/js/core/libraries/bootstrap.min.js') !!}"></script> it works fine. Thanks !
For other that want to remove Laravel's included boostrap there is line in boostrap.js (not related to Twitter boostrap) that requires it
you are my hero

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.