3

Problem:

  • Vue component renders on screen as <!---->

Setup:

  • Application is in C# Core 2.0
  • Vue version 2.5.16
  • Use gulp to copy static js files to /wwwroot
    gulp.src('./node_modules/vue/dist/vue.min.js') .pipe(gulp.dest('./wwwroot/dist/'))
  • Call to load Vue in HTML
    <script src="~/dist/vue.min.js" asp-append-version="true"></script>
  • I have four components. Two use string literal templates and two use <template>. Of the later, only one displays.
    <template id="paging-template"></template> <template id="modal-template"></template>

    Vue.component('modal',{ template:'#modal-template'}); Vue.component('paging',{ template:'#paging-template'});

Modal is called with <modal></modal> and Paging with <paging></paging>.

Modal displays properly. Paging displays as <!----> but using the Vue debugger addon in Chrome I can see the model and everything for the Paging component is there.

What am I missing?

Edit: JSFiddle Link

This css is not mine, just the default on the Vue template they provide

4
  • 2
    Can you display the syntax for your index.html and application.vue or main vue page. Commented May 10, 2018 at 21:09
  • You haven't provided enough information for us to determine what the problem is. Commented May 10, 2018 at 22:13
  • I do not have any .vue files. My Vue model is instantiated in a regular .js file loaded to the page. If not enough information was provided could you please specify what information you are looking for? Commented May 11, 2018 at 0:15
  • Link to JSFiddle provided Commented May 11, 2018 at 13:00

1 Answer 1

1

There are a number of things wrong with your example(All of them are visible in the console tab of the browser):

Your class binding syntax is incorrect. All instances where you are trying to bind classes as follows:

v-bind:class="'disabled': previousDisabled"

Should be updated to:

v-bind:class="{disabled: previousDisabled}"

isNumber is not a method. It can be replaced with !Number.isNaN(

Updated JSFiddle

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

1 Comment

My hero...I had spent so much time staring at the code I had become blind to these obvious mistakes. And sadly my console wasn't showing any errors.

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.