data(){ return{ crux:[] //声明下变量 } }, mounted:function(){ var cruxs = localStorage.historyItems.split(","); this.crux = cruxs; //把需要绑定的变量,赋值给data里面声明的变量 },
vue.js把mounted里面的变量传到data里面
猜你喜欢
转载自www.cnblogs.com/tomyangym/p/9174333.html
今日推荐
周排行