微信小程序组件中properties定义变量,在外部修改组件样式

组件js中:

Component({
  properties: {
  imageClass: { type: String, value: '' }
  },

组件wxml:


		
      
    

组件wxss:

.modifyImage {
  width: 200rpx;
  height: 300rpx;
  background: pink;
}

页面wxml:

 

你可能感兴趣的:(小程序)