| 1234567891011121314151617181920212223242526272829 |
- // components/header/header.js
- Component({
- properties: {
- // header嵌入的位置,index:首页
- position:{
- type:String,
- value:''
- }
- },
- data: {
- index:0
- },
- observers:{
- // 是否是预售、新品、上架
- position:function(value){
- this.setData({
- specialProds:value === "new" || value === "hot" || value === "presale" || value === "sort"
- })
- }
- },
- methods: {
- backHome(){
- wx.navigateBack(-1);
- },
- },
- ready: function(){
- console.log(this.data.position);
- }
- })
|