功能:=》大于1000用kg表示 小于1000,用g表示

	计算属性  计算属性必须是有一个返回值的哦  
	在html写被计算的值
	在computed中去直接调用哈

		<view>
			<text>{{jisuweight}}</text>
		</view>
		
		data() {
			return {
				weight:1110,
			}
		},
		computed:{
			jisuweight(){
				return this.weight>1000 ? (this.weight/1000)+"kg" : this.weight;
			}
		},

相关文章:

  • 2021-09-13
  • 2021-08-17
  • 2021-07-28
  • 2021-11-28
  • 2021-05-22
  • 2022-01-26
  • 2022-12-23
猜你喜欢
  • 2021-04-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-03
  • 2021-12-26
  • 2021-11-06
相关资源
相似解决方案