Vue reported an error vue.js:525 [Vue warn]: Cannot find element:-sharpapp

when I started learning vue.js, I reported an error vue.js:525 [Vue warn]: Cannot find element:-sharpapp
here is my code:

clipboard.png

clipboard.png


do not put it in template, because the template element is-sharpdocument-fragment, in the DOM tree, so the div in it cannot be found, see https://developer.mozilla.org..


template is written as a single component. Without templete, generally vue projects are built with vue-cli


vue2.0. The same problem cannot be solved.


the main file definition does not need to be wrapped with template, and the subcomponent definition requires only one root element, so template is usually used to wrap

.
Menu