html

 <img :src="getMore('up')" alt="">

data里面定义的

        one: 'http://p1.fishqc.net/FiYvORyEWsDqy7MD59eFEjow9OuD!product.thumb',
        two: 'http://p1.fishqc.net/FvGkVaj-YTtjDenS4QruNTKz0JX0!product.thumb'

methods

 methods: {
        getMore (type) {
          if (type === 'up') {
            return el = this.one
          } else {
            return el = this.two
          }  
        }

 }
posted on 2019-06-17 17:00  周小姐你好  阅读(192)  评论(0)    收藏  举报