Skip to content

Commit

Permalink
respect eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
airyland committed Jan 12, 2017
1 parent 9632ebe commit 3c79552
Show file tree
Hide file tree
Showing 15 changed files with 42 additions and 44 deletions.
20 changes: 10 additions & 10 deletions src/components/calendar/index.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<template>
<div>
<cell :title="title" primary="content" :value="props_value" @click.native="onClick" is-link></cell>
<cell :title="title" primary="content" :value="currentValue" @click.native="onClick" is-link></cell>
<popup v-model="show">
<inline-calendar
v-model="props_value"
v-model="currentValue"
@on-change="onSelect"
:render-month="renderMonth"
:start-date="startDate"
Expand Down Expand Up @@ -43,8 +43,8 @@ export default {
Popup,
Cell
},
created(){
this.props_value=this.value
created () {
this.currentValue = this.value
},
props: Props,
methods: {
Expand All @@ -53,19 +53,19 @@ export default {
},
onSelect (val) {
this.show = false
this.props_value=val
this.$emit('on-change',val)
this.currentValue = val
this.$emit('on-change', val)
}
},
watch:{
value(val){
this.props_value=val
watch: {
value (val) {
this.currentValue = val
}
},
data () {
return {
show: false,
props_value:''
currentValue: ''
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/components/checker/checker-item.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default {
}
} else {
if (typeof this.value === 'string') {
if (this.$parent.currentValue.indexOf(this.value) > -1){
if (this.$parent.currentValue.indexOf(this.value) > -1) {
selected = true
}
} else if (this.$parent.currentValue && this.$parent.currentValue.length) {
Expand Down Expand Up @@ -75,11 +75,11 @@ export default {
const isSimpleValue = typeof this.value === 'string' || typeof this.value === 'number'
if (!this.disabled) {
let index = -1
if (isSimpleValue){
if (isSimpleValue) {
index = this.$parent.currentValue.indexOf(this.value)
} else {
index = this.$parent.currentValue.map(one=>JSON.stringify(one)).indexOf(JSON.stringify(this.value))
}
index = this.$parent.currentValue.map(one => JSON.stringify(one)).indexOf(JSON.stringify(this.value))
}
if (index > -1) {
this.$parent.currentValue.splice(index, 1)
} else {
Expand Down
2 changes: 0 additions & 2 deletions src/components/checklist/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ export default {
this.$emit('on-change', val)
this.$emit('input', val)
let key = this.name || this.uuid
let err = {}
if (this._min) {
if (this.required) {
Expand All @@ -152,7 +151,6 @@ export default {
} else {
this.$emit('on-clear-error')
}
}
}
}
Expand Down
12 changes: 7 additions & 5 deletions src/components/confirm/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,24 @@ export default {
},
created () {
this.showValue = this.show
if(this.value) this.showValue = this.value
if (this.value) {
this.showValue = this.value
}
},
watch: {
value (val) {
this.showValue = val
},
showValue (val){
this.$emit('input',val)
showValue (val) {
this.$emit('input', val)
},
show (val) {
this.showValue = val
}
},
data (){
data () {
return {
showValue:false
showValue: false
}
},
methods: {
Expand Down
8 changes: 4 additions & 4 deletions src/components/countdown/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ export default {
default: true
}
},
created (){
created () {
this.currentTime = this.time
if(this.value) this.currentTime = this.value
if (this.value) this.currentTime = this.value
},
methods: {
tick () {
Expand All @@ -33,10 +33,10 @@ export default {
}
},
watch: {
value (val){
value (val) {
this.currentTime = val
},
currentTime (val){
currentTime (val) {
this.$emit('input', val)
},
start (newVal, oldVal) {
Expand Down
6 changes: 3 additions & 3 deletions src/components/datetime/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ export default {
this.currentValue = this.value
this.handleChangeEvent = true
},
data(){
return{
data () {
return {
currentValue: ''
}
},
Expand Down Expand Up @@ -126,7 +126,7 @@ export default {
}
},
watch: {
currentValue (val){
currentValue (val) {
this.$emit('on-change', val)
this.$emit('input', val)
},
Expand Down
4 changes: 2 additions & 2 deletions src/components/inline-calendar/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default {
currentValue: ''
}
},
created(){
created () {
this.currentValue = this.value
},
mounted () {
Expand All @@ -80,7 +80,7 @@ export default {
}
},
watch: {
value(val){
value (val) {
this.currentValue = val
},
currentValue (val) {
Expand Down
12 changes: 6 additions & 6 deletions src/components/rater/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<script>
export default {
created(){
created () {
this.currentValue = this.value
},
mounted () {
Expand Down Expand Up @@ -57,11 +57,11 @@ export default {
methods: {
handleClick (i, force) {
if (!this.disabled || force) {
if (this.currentValue === i +1 ) {
if (this.currentValue === i + 1) {
this.currentValue = i
this.updateStyle()
} else {
this.currentValue = i +1
this.currentValue = i + 1
}
}
},
Expand All @@ -78,13 +78,13 @@ export default {
data () {
return {
colors: [],
currentValue:0
currentValue: 0
}
},
watch: {
currentValue(val){
currentValue (val) {
this.updateStyle()
this.$emit('input',val)
this.$emit('input', val)
},
value (val) {
this.currentValue = val
Expand Down
3 changes: 1 addition & 2 deletions src/components/scroller/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export default {
handler: function (val) {
this.$emit('input', pure(val))
},
deep:true
deep: true
},
value: {
handler: function (val) {
Expand Down Expand Up @@ -205,7 +205,6 @@ export default {
if (this.$slots.default) {
content = this.$slots.default[0].elm
}
if (!content) {
throw new Error('no content is found')
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/swiper/swiper.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,4 +338,4 @@ class Swiper {
}
}

export default Swiper
export default Swiper
2 changes: 1 addition & 1 deletion src/components/swiper/swiper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default {
return
}
this.$nextTick(() => {
this.index = this.value ||0
this.index = this.value || 0
this.current = this.value || 0
this.length = this.list.length || this.$children.length
this.destroy()
Expand Down
1 change: 0 additions & 1 deletion src/components/x-input/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ export default {
delete this.errors.format
}
}
if (this.min) {
if (this.currentValue.length < this.min) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/x-textarea/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export default {
},
spellcheck: {
type: String,
default:'false'
default: 'false'
}
},
created () {
Expand Down
2 changes: 1 addition & 1 deletion src/demos/FormPreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,5 @@ export default {
}]
}
}
}
}
</script>
2 changes: 1 addition & 1 deletion src/filters/value2name.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ export default function (value, list, delimiter) {
return map(rs, one => {
return one.name
}).join(delimiter).replace('--', '')
}
}

0 comments on commit 3c79552

Please sign in to comment.