Vue warn]: Error compiling template: Templates should only be responsible for mapping the state to

vueJs出现Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as

模板应该只负责将状态映射到ui。避免在模板中放置带有副作用的标记,例如

错误代码

<body>

<div id="app">
<mycom1>
mycom1>
<script>
 Vue.component('mycom1',{
      
	template:'

Vue.extend创建的组件

'
}) var vm=new Vue({ el:' #app', })
script> div> body>

Vue warn]: Error compiling template: Templates should only be responsible for mapping the state to_第1张图片

原因
原因是你新建VUE实例的代码放在了被绑定的组件
,将’<‘script>标签写到’<'body>’外

你可能感兴趣的:(vue,Vue,warn]:,Error,compiling,template,:,Templates,should,only,be,respons)