最近学习到的小知识

最近学习到的小知识

h5 获取经纬度

javascript
function getLocation() {
    if (navigator.geolocation) {
        navigator.geolocation.getCurrentPosition((res) => {
            console.log("经度" + res.coords.longitude + "纬度" + res.coords.latitude)
        })
    }
    else {
        alert("Geolocation is not supported by this browser.")
    }
}

Nuxt3 ssg 报错问题处理

可以在 nuxt.config.ts 中添加如下配置试试

nitro: {
  routeRules: {
    "/*": {
      cors: true,
    },
  },
  prerender: {
    crawlLinks: true,
    failOnError: false,
  },
  externals: {
    traceInclude: [],
  },
}
ECharts 在 vue2 中的实践
十年之约

评论区

评论加载中...