PHP Classes

File: public/js/lib/vue/src/directives/element/partial.js

Recommend this page to a friend!
  Classes of Sergey Beskorovayniy   Silex MVC Blog   public/js/lib/vue/src/directives/element/partial.js   Download  
File: public/js/lib/vue/src/directives/element/partial.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Silex MVC Blog
MVC based blog using on the Silex micro-framework
Author: By
Last change:
Date: 8 years ago
Size: 851 bytes
 

Contents

Class file image Download
import vIf from '../public/if' import FragmentFactory from '../../fragment/factory' import { PARTIAL } from '../priorities' import { createAnchor, replace, resolveAsset } from '../../util/index' export default { priority: PARTIAL, params: ['name'], // watch changes to name for dynamic partials paramWatchers: { name (value) { vIf.remove.call(this) if (value) { this.insert(value) } } }, bind () { this.anchor = createAnchor('v-partial') replace(this.el, this.anchor) this.insert(this.params.name) }, insert (id) { var partial = resolveAsset(this.vm.$options, 'partials', id, true) if (partial) { this.factory = new FragmentFactory(this.vm, partial) vIf.insert.call(this) } }, unbind () { if (this.frag) { this.frag.destroy() } } }