简体   繁体   English

表格无法使用Vue.js正确呈现

[英]Table not Rendering properly with vuejs

I have vuejs component that generates the rows for a table. 我有vuejs组件,它为表生成行。 The code for the component is below. 该组件的代码如下。

The component loads the value above the table without is='constitutionrow' line, but with the is keyword, and the following error occurred: 该组件将在表上方加载值,而不使用is='constitutionrow'行,但使用is关键字,并且发生以下错误:

error of Uncaught RangeError: Maximum call stack size exceeded Uncaught RangeError的错误:超出最大调用堆栈大小

Any suggestion on how to fix it would help. 关于如何修复它的任何建议都将有所帮助。

    Vue.component('constitutionrow', {props: ['id','fid','jlpcandidate','constitution','pnpcandidate','votesjlp','votespnp'],
template:
" <tr 'constitutionrow'>" +
"<td> {{ id }}</td>" +
"<td>{{ fid }}</td>" +
"<td>{{ constitution }}</td> " +
"<td>{{ jlpcandidate }}</td>"  +
"<td>{{ pnpcandidate }}</td>" +
"<td>{{ votesjlp }}</td>"+
"<td>{{ votespnp }}</td>" +
" <td class='center'>" +
"<div>" +
"<a id='' class='glyphicon glyphicon-edit editbtn'  v-on:click='editRecord()'></a>" +
"</div>" +
"</td>" +
" </tr>",

data: function ()
 {

    return {

        hidden: true,
        show: false,
        selectedAnswerer:'',
    }
},
methods: {
    editRecord:function()
    {

        $('.editbtn').colorbox({
            html:"" +
            "<div id='editformConstituency'  class='form-group'>" +
            " <label >Fid</label> <input type='text'  v-model='fid' value='self.' class='form-control'> " +
            " <label >Constitution</label> <input type='text'  v-model='constitution' class='form-control'>"+
            " <label >JLP Candidate</label> <input type='text'  v-model='jlpCandidate' class='form-control'>"+
            " <label >PNP Candidate</label><input type='text'  v-model='phpCandidate' class='form-control'>" +
            " <label >Votes JLP </label> <input type='text'  v-model='votesJLP' class='form-control'>"+
            " <label >Votes PNP </label> <input type='text'  v-model='votesPnp' class='form-control'>"+
            "<button v-on:click='submitEdit()'>Submit</button>"+
            "  <script src='http://localhost/ElectionMapApplication/public/js/vuecontrollers/editFormConstituency.js'></script>" +
            "</div>",
            width: "75%",
            height: "75%",
            onComplete: function(){
                var bg = $.colorbox.element().data('bg');
                $('#cboxLoadedContent').css('backgroundColor', bg);
            }
        });
        },
}});

Values Appear Above table Values Appear Above Table 值出现在表格上方值出现在表格上方

That error generally means you have a function that is calling itself. 该错误通常表示您有一个正在自我调用的函数。 The HTML in there is your template for the constitutionrow component, but within it you have a <tr is='constitutionrow'> which is creating another constitutionrow component. 那里的HTML是您用于构造行组件的模板,但是其中有一个<tr is='constitutionrow'> ,它正在创建另一个构造行组件。 This would keep going endlessly. 这将不断进行下去。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM