2

This is my html:

<div id="modalComponent">
    <remodal-designs v-binds:designid="1074"></remodal-designs>
</div>

This is my scripts in the html:

<script src="{{ FuImg::asset('js/libs/vue.min.js') }}"></script>
<script src="{{ FuImg::asset('js/vue_components/remodal_designs.js') }}"></script>

And this is my Vue js component:

Vue.component('remodal-designs', {

    template : '<div id="modaldesigns" class="cp-remodal remodal" :data-remodal-id="designid">\
                    <button data-remodal-action="close" class="remodal-close"></button>\
                    <div class="container">\
                        <div class="row no-gutter">\
                            <div class="col-sm-6">\
                                <div class="cp-tab-menu active">\
                                    Camisetas Premium\
                                </div>\
                            </div>\
                            <div class="col-sm-6">\
                                <div class="cp-tab-menu">\
                                   Camisetas Basic\
                                </div>\
                            </div>\
                        </div>\
                    </div>\
                </div>\
    ',

    props : ['designid'],



});

The component is not rendering. When I open the chrome browser and use Ctrl + U to see the code, nothing is being done. enter image description here

The Chrome console not return errors.

What am I doing wrong?

EDIT: the vue console report this

[Vue warn]: failed to compile template:

<div id="modalComponent">
    <remodal-designs v-bind:designid="5rpexo1zwci6"></remodal-designs>
</div>

- invalid expression: v-bind:designid="1074"


(found in root instance)
5
  • Don't use the minified version in development otherwise you won't get all the console errors. Change to the non minified version and see if you get any errors. Commented Feb 22, 2017 at 14:51
  • @craig_h I edited the main post Commented Feb 22, 2017 at 14:55
  • Could you add the data you are using in your main vue instance? Commented Feb 22, 2017 at 15:10
  • You just need to have designid="1074", remove v-bind as you are not assigning it to any vue data variable. Commented Feb 22, 2017 at 15:14
  • and what is in your main.js ? Commented Feb 22, 2017 at 17:57

1 Answer 1

3

In HTML, remove v-bind:

<div id="modalComponent">
    <remodal-designs designid="1074"></remodal-designs>
</div>

v-bind is used when you dynamically bind one or more attributes or a component prop to an expression or vue data. Here as you are passing a constant so it is not needed.

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

Comments

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.