You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
401 B
26 lines
401 B
Page({
|
|
num1:0,
|
|
num2:0,
|
|
data:{
|
|
result:''
|
|
},
|
|
input1(e){
|
|
this.num1=Number(e.detail.value)
|
|
},
|
|
input2(e){
|
|
this.num2=Number(e.detail.value)
|
|
},
|
|
compare(){
|
|
var str=''
|
|
if(this.num1>this.num2){
|
|
str='第一个数大'
|
|
}else if(this.num1<this.num2){
|
|
str='第二个数大'
|
|
}else{
|
|
str='一样大'
|
|
}
|
|
this.setData({
|
|
result:str
|
|
})
|
|
}
|
|
}) |