美文网首页
js使用vue 不在脚手架开发情况下使用地图/轮播图等插件

js使用vue 不在脚手架开发情况下使用地图/轮播图等插件

作者: 小北酱丶 | 来源:发表于2019-03-27 14:13 被阅读0次

使用万能的that.$nextTick!

 that.$nextTick(function () {
                    that.init();
                })
$(function () {
    var dataMap = new Vue({
        el: "#content",
        data: function () {
            return {

            }
        },
        created: function () {
            this.maplist();
        },
        methods: {
            maplist:function(){
                var that = this 
                that.$nextTick(function () {
                    that.init();
                })
            },
            init: function () {
                var map = new AMap.Map('container', {
                    zoom: 11,//级别
                    center: [116.397428, 39.90923],//中心点坐标
                    viewMode: '3D'//使用3D视图
                });
            }
        },
    })
})

相关文章

网友评论

      本文标题:js使用vue 不在脚手架开发情况下使用地图/轮播图等插件

      本文链接:https://www.haomeiwen.com/subject/tgjzvqtx.html