根据路由传值动态改变placeholder的值???

根据路由传值动态改变placeholder的值???

 

       1. 先获取路由传的值  

 this.$route.query.recruitType;
       

       2. 改变placeholder的属性

 let pla = document.getElementById("pla").setAttribute("placeholder","市场名称");  

       具体代码如下:

  

let recruitType = this.$route.query.recruitType; if(recruitType == 1){ let pla = document.getElementById("pla").setAttribute("placeholder","市场名称"); }else if(recruitType == 2){ let pla = document.getElementById("pla").setAttribute("placeholder","商家名称"); }
 

你可能感兴趣的:(采坑之路)