首页 > 技术文章 > vue 项目 添加自定义方法

handsome-jm 2017-12-05 16:47 原文

添加位置和方法

举例说明:

export default{
  name: 'Home',
  data () {
    return {
       msg: 'msg'        
    }
  },
  directives: {
    focus: {
      inserted: function (el) {
        el.focus()
      }
    }
  }
}

  

推荐阅读