答案 0 :(得分:1)
我通过鼠标右键点击function init(){
console.log('start');
var num1 = 0;
var num2 = 0;
var op = '';
var ON = '';
$('.digit, .operator orange').click(function(){
var ID = this.id;
console.log(ID);
calculator(this);
});
function calculator(obj){
console.log(ON);
var ID = obj.id;
var type = obj.classList[1];
if(type === 'digit'){
if (ON == true){
$('#calculation').empty();
}
$('#calculation').append(ID);
console.log(ID + '!')
}else if(type === 'operator orange'){
op =obj.textContent;
if(num1 == 0){
num1 = $('#calculation').text();
}else{
num2 = $('#calculation').text();
num1 = eval(num1 + op + num2);
}
$('#calculation').empty();
}else if (type ==='operator orange'){
num2 = $('#calculation').text();
num1 = eval(num1 + op + num2);
$('#calculation').empty();
$('#calculation').append(num1);
ON = true;
num1= 0;
num2= 0;
}else if(type === 'clear'){
$('#calculation').empty();
num1=0;
num2=0;
ON = false;
}
}
}
$(document).ready(init);
解决了这个问题,点击导入,选择现有Maven项目,选择我的项目和完成。
编辑:您还可以选择导入为项目