1.index.js上写着命令
//获取焦点exportconstfocustest={ inserted : function (El ) { el.focus ) }2.当前页面需要根据需要引入和使用命令
import { focus test } from ' ./directives/index.js '//根据自己的要求写路径directives 3360 { focus test 3360 focus test }3. html
inputv-focus testv-model=' message ' placeholder=' test '4.完成