uni-app 动态添加class

<view :class="{'click': add_class == 2}" @tap='addCalss(2)'> 
view>
data() {
			return {
				add_class:'',//动态添加class类名
			}
		},
		methods: {
			// 动态添加class
			addCalss(data){
				this.add_class  = data
			}
		}

你可能感兴趣的:(uni-app,uni-app)