vue还可以这样写

1、这两种写法都可以:

var vm = new Vue({
  data(){
        return {
           scaleFlag:'big',
        }
    },
    //data:{},
    created: function () {
    
    },
    methods:{ 
    //scale:function(){
    //scale(){

    },
    mounted:function(){
    //mounted(){
    
    }
})

2、Vue挂载 

var vm = new Vue({
    el:'#app',
    data:{},        
})
 // 或:        
vm.$mount(document.getElementById('app'));
 // 或:
vm.$mount('#app');
原文地址:https://www.cnblogs.com/liubingyjui/p/12755466.html