在vue中的created函数中,定义window.函数名=this.函数名。
created:function(){ window.clicktower=this.clicktower; }, methods: { clicktower:function(index){ ** } }