@ylz/plugins
Version:
ylz plugins
3 lines (2 loc) • 808 B
JavaScript
/* * Copyright © 2019-2019 chenwenbin * Released under the MIT License. */
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e=e||self).ref=n()}(this,(function(){"use strict";return{install:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.name||"ref";e.directive(t,{bind:function(e,n,t){n.value(t.componentInstance||e,t.key)},update:function(e,n,i,o){if(o.data&&o.data.directives){var u=o.data.directives.find((function(e){return e.name===t}));if(u&&u.value!==n.value)return u&&u.value(null,o.key),void n.value(i.componentInstance||e,i.key)}i.componentInstance===o.componentInstance&&i.elm===o.elm||n.value(i.componentInstance||e,i.key)},unbind:function(e,n,t){n.value(null,t.key)}})}}}));