How do I introduce .vue files into traditional pages?

how do I introduce .vue files into traditional pages?


The

.vue file is actually meant to make vue componentized. If not, you can manually add the desired component, put the component's style in the css file, and put the template and js in the component.
there are two ways, one is the global component:

Vue.component('my-component', {
  template:'',
   data:function(){
     return {}
}
})

the other is local components,
directly

  var   myComponentName = {
        template:"",
        data:function(){
        }
    }

I hope I can help you


The

.vue file is intended to make it easier for users to manage resources and reduce the cost caused by the previous dispersion of resources. In essence, it is not natively supported by HTML, so it is impossible to reference painlessly in traditional pages. So first of all, the subject needs to change his mind, give up the idea of introducing .vue files into traditional pages, and instead consider what your needs are and how best to meet them.

from my point of view, .vue was introduced to reuse vue components, especially those that have been developed elsewhere. Then this situation should obviously be "referenced anyway," so consider using an entry file to import and compile the .vue file.

Global registration is also a good way to use it as a component.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b2b6d6-2adf8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b2b6d6-2adf8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?