134  
查询码:00000457
VUE百度地图换肤
作者: 裴蕾 于 2019年12月27日 发布在分类 / 数字可视化 / 三维制作设计 下,并于 2019年12月27日 编辑

 在切换皮肤的组件里加入如下代码

theme() {

       localStorage.setItem("baidustyle", "1");
 },
    theme2() {
       localStorage.setItem("baidustyle", "2");
  

    },

地图页面  :mapStyle="getCurrentStyle"

computed: {
    getCurrentStyle() {
        var cur=localStorage.getItem("baidustyle");
      if(cur=="1")
      {
        return mapStyle;
      }
      return mapStyle
    }
  },



 推荐知识

 历史版本

修改日期 修改人 备注
2019-12-27 10:23:27[当前版本] 裴蕾 1.0

知识分享平台 -V 4.8.7 -wcp