添加位置和方法
举例说明:
export default{ name: ‘Home‘, data () { return { msg: ‘msg‘ } }, directives: { focus: { inserted: function (el) { el.focus() } } } }
vue 项目 添加自定义方法
原文:http://www.cnblogs.com/handsome-jm/p/7988057.html