Skip to content

Commit

Permalink
upd: prettier:fix
Browse files Browse the repository at this point in the history
  • Loading branch information
richard1015 committed Jul 9, 2020
1 parent ec65249 commit 38ef397
Show file tree
Hide file tree
Showing 41 changed files with 1,221 additions and 1,399 deletions.
19 changes: 9 additions & 10 deletions src/mixins/touch.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import Vue from "vue";
import Vue from 'vue';

const MIN_DISTANCE = 10;

function getDirection(x, y) {
if (x > y && x > MIN_DISTANCE) {
return "horizontal";
return 'horizontal';
}

if (y > x && y > MIN_DISTANCE) {
return "vertical";
return 'vertical';
}

return "";
return '';
}

const TouchMixin = Vue.extend({
data() {
return { direction: "" };
return { direction: '' };
},

methods: {
Expand All @@ -32,17 +32,16 @@ const TouchMixin = Vue.extend({
this.deltaY = touch.clientY - this.startY;
this.offsetX = Math.abs(this.deltaX);
this.offsetY = Math.abs(this.deltaY);
this.direction =
this.direction || getDirection(this.offsetX, this.offsetY);
this.direction = this.direction || getDirection(this.offsetX, this.offsetY);
},

resetTouchStatus() {
this.direction = "";
this.direction = '';
this.deltaX = 0;
this.deltaY = 0;
this.offsetX = 0;
this.offsetY = 0;
},
},
}
}
});
export default TouchMixin;
4 changes: 2 additions & 2 deletions src/packages/actionsheet/actionsheet.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ export default {
deactivated() {
this.remolveLockScroll();
},
destroyed(){
destroyed() {
this.remolveLockScroll();
},
methods: {
remolveLockScroll(){
remolveLockScroll() {
document.body.classList.remove('nut-overflow-hidden');
},
isHighlight(item) {
Expand Down
26 changes: 11 additions & 15 deletions src/packages/address/address.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
@open="closeWay = 'self'"
>
<div class="title">

<span class="arrow" @click="switchModule" v-if="showModule == 'custom' && type == 'exist' && backBtnIcon">
<nut-icon type="self" :url="backBtnIcon"></nut-icon>
<nut-icon type="self" :url="backBtnIcon"></nut-icon>
</span>
<span class="arrow" v-else></span>

Expand Down Expand Up @@ -139,12 +138,12 @@ export default {
type: String,
default: require('../../assets/svg/tick-red.svg')
},
closeBtnIcon:{
closeBtnIcon: {
// 关闭弹框按钮 icon
type: String,
default: require('../../assets/svg/circle-cross.svg')
},
backBtnIcon:{
backBtnIcon: {
// 选择其他地址左上角返回 icon
type: String,
default: require('../../assets/svg/arrows-back.svg')
Expand Down Expand Up @@ -282,7 +281,7 @@ export default {
this.handClose();
},
// 关闭
close() {
const that = this;
Expand All @@ -308,8 +307,7 @@ export default {
if (this.closeWay == 'self') {
this.$emit('close', res);
} else {
this.$emit('closeMask',{'closeWay':this.closeWay});
this.$emit('closeMask', { closeWay: this.closeWay });
}
setTimeout(() => {
Expand All @@ -318,11 +316,10 @@ export default {
},
// 手动关闭 点击叉号(cross),或者蒙层(mask)
handClose(type = 'self') {
if (!this.closeBtnIcon) return;
if(!this.closeBtnIcon) return
this.closeWay = type == 'cross' ? 'cross' : 'self';
this.closeWay = type == 'cross'?'cross':'self'
this.showPopup = false;
},
// 点击遮罩层关闭
Expand All @@ -339,11 +336,10 @@ export default {
},
// 选择其他地址
switchModule() {
if(this.showModule == 'exist'){
this.showModule = 'custom'
}else{
this.showModule = 'exist'
if (this.showModule == 'exist') {
this.showModule = 'custom';
} else {
this.showModule = 'exist';
}
this.initAddress();
Expand Down
4 changes: 2 additions & 2 deletions src/packages/address/demo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ export default {
}
},
closeMask(val){
console.log('关闭弹层',val)
closeMask(val) {
console.log('关闭弹层', val);
}
}
};
Expand Down
4 changes: 2 additions & 2 deletions src/packages/cell/demo.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<div class="demo-list">
<h4>基本用法</h4>
<nut-cell title="我是标题" desc="描述文字" @click-cell="clickEvnt" to="/index"> </nut-cell>
<nut-cell :is-link="true" link-url="//m.jd.com" :show-icon="true" title="带链接" target="_target"> </nut-cell>
<nut-cell title="我是标题" desc="描述文字" @click-cell="clickEvnt" to="/index"> </nut-cell>
<nut-cell :is-link="true" link-url="//m.jd.com" :show-icon="true" title="带链接" target="_target"> </nut-cell>
<h4>通过Slot插槽分发内容</h4>
<div>
<nut-cell :is-link="true" :show-icon="true">
Expand Down
Loading

0 comments on commit 38ef397

Please sign in to comment.