❶ js里报错Cannot read property 'zoom' of undefined
在读取之前 没看到d3在哪里声明赋值了所以d3为undefined d3.behavior也为undefined 因此,会报错解决方法:在访问该变量之前先声明赋值