PHP Classes

File: public/js/lib/vue/src/directives/public/model/radio.js

Recommend this page to a friend!
  Classes of Sergey Beskorovayniy   Silex MVC Blog   public/js/lib/vue/src/directives/public/model/radio.js   Download  
File: public/js/lib/vue/src/directives/public/model/radio.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: 7 years ago
Size: 678 bytes
 

Contents

Class file image Download
import { toNumber, looseEqual } from '../../../util/index' export default { bind () { var self = this var el = this.el this.getValue = function () { // value overwrite via v-bind:value if (el.hasOwnProperty('_value')) { return el._value } var val = el.value if (self.params.number) { val = toNumber(val) } return val } this.listener = function () { self.set(self.getValue()) } this.on('change', this.listener) if (el.hasAttribute('checked')) { this.afterBind = this.listener } }, update (value) { this.el.checked = looseEqual(value, this.getValue()) } }