<div id="app">
{{foo}}
</div>
<script>
const app = new Vue({
el: '#app',
template: `<div>hello template</div>`,
render: (h) => {
return h('div', 'hello render')
},
data() {
return {
foo: 'hello vue'
}
}
})
</script>
vue中el,template,render的优先级会执行哪个? entry-runtime-with-compiler.js中找到答案
在vue源码中找到答案
所以 三者 的 优先级为 render>template>el