warning:mapbox-gl.js:31 This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.
大概意思就是mapbox-gl
的css
文件没有import
进来
解决办法:引入css文件,亲测可用
import 'mapbox-gl/dist/mapbox-gl.css'