vue 引入图片用require


data: function () {
        return {
            toolBarData: [
                {
                    nIcon: require('@img/home-n.svg'),
                    hIcon: require('@img/home-h.svg'),
                    name: '首页',
                    componentName: 'home'
                },
                {
                    nIcon: require('@img/shopping-n.svg'),
                    hIcon: require('@img/shopping-h.svg'),
                    name: '购物车',
                    componentName: 'shopping'
                },
                {
                    nIcon: require('@img/my-n.svg'),
                    hIcon: require('@img/my-h.svg'),
                    name: '我的',
                    componentName: 'my'
                }
            ],
            selectIndex: 0,
            isIphoneX: window.isIphoneX
        }
    }
posted @ 2020-10-14 14:26  麦子同学  阅读(2622)  评论(1编辑  收藏  举报