猿问

学习vue.js组件使用props属性报错,按照官方文档写,但报错

代码如下

 <div id="box6">

      <my-component2 :showInfor="hello"></my-component2>

      <my-component2 :showInfor="hi"></my-component2>

 </div>

 

 <script type="text/javascript">

     Vue.component('my-component2',{

          props: ['showInfor'],

          template: "<div><h4>{{showInfor}}</h4></div>",

          computed: {

            showInforRes: function(){

              return this.showInfor+" world!"

            }

          }

        })

        var com2 = new Vue({

          el: '#box6'

        })

</script>

报错如下

梵蒂冈之花
浏览 635回答 1
1回答
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答