/* global Vue */
import html from './button.html'

(function (v) {
  v.component('j-button', {
    props: ['action', 'type', 'width', 'height', 'round'],
    template: html,
    computed: {
      classObject: function () {
        return {
          'j-border-primary': !this.type || this.type === 'theme',
          'j-text-primary': !this.type,
          'j-bg-primary': this.type === 'theme',
          'j-font-primary': this.type === 'theme',
          'j-button-text': this.type === 'text',
          'j-click-button': !this.round && this.type !== 'disabled',
          'j-click-round-button': this.round && this.type !== 'disabled',
          'j-button-red': this.type === 'red',
          'j-button-green': this.type === 'green',
          'j-button-blue': this.type === 'blue',
          'j-button-yellow': this.type === 'yellow',
          'j-button-disabled': this.type === 'disabled'
        }
      },
      a: function () {
        return this.type === 'disabled' ? function () { return false } : (this.action || function () { return false })
      },
      w: function () {
        return this.width ? Number(this.width) + 'px' : 'auto'
      },
      h: function () {
        return this.height ? Number(this.height) + 'px' : '36px'
      },
      l: function () {
        return this.height ? Number(this.height) - 2 + 'px' : '34px'
      }
    }
  })
})(Vue)

@@ -1092,24 +1092,37 @@
      return 
+isNaN(Number(
 this.width ?
@@ -1119,18 +1119,33 @@
 is.width
+))
  ?
+ this.width :
  Number(
@@ -1166,17 +1166,8 @@
 'px'
- : 'auto'
 %0A   
@@ -1202,32 +1202,45 @@
 %0A        return 
+isNaN(Number(
 this.height ? Nu
@@ -1226,34 +1226,49 @@
 mber(this.height
+))
  ?
+ this.width :
  Number(this.hei
@@ -1282,17 +1282,8 @@
 'px'
- : '36px'
 %0A   
@@ -1377,14 +1377,12 @@
 ' : 
-'34px'
+null
 %0A   

修改button插件，width属性带单位时无效的bug