template和render的优先级?

  <body>
    <div id="app">
      <p>{{message}}</p>
    </div>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.11/vue.js"></script>
    <script>
      new Vue({
        el: '#app',
        data() {
          return { message: 'hello el' }
        },
        template: '<div>hello template</div>',
        render(h) {
          return h('div', {}, 'hello render')
        }
      })
    </script>
  </body>

优先级:render > template > el

posted @ 2021-08-06 17:28  吴小明-  阅读(122)  评论(0编辑  收藏  举报