换ubuntu
This commit is contained in:
2
utils/dist/popup/index.d.ts
vendored
2
utils/dist/popup/index.d.ts
vendored
@@ -1 +1 @@
|
||||
export {};
|
||||
export {};
|
||||
|
||||
160
utils/dist/popup/index.js
vendored
160
utils/dist/popup/index.js
vendored
@@ -1,80 +1,80 @@
|
||||
import { VantComponent } from '../common/component';
|
||||
import { transition } from '../mixins/transition';
|
||||
VantComponent({
|
||||
classes: [
|
||||
'enter-class',
|
||||
'enter-active-class',
|
||||
'enter-to-class',
|
||||
'leave-class',
|
||||
'leave-active-class',
|
||||
'leave-to-class'
|
||||
],
|
||||
mixins: [transition(false)],
|
||||
props: {
|
||||
round: Boolean,
|
||||
closeable: Boolean,
|
||||
customStyle: String,
|
||||
overlayStyle: String,
|
||||
transition: {
|
||||
type: String,
|
||||
observer: 'observeClass'
|
||||
},
|
||||
zIndex: {
|
||||
type: Number,
|
||||
value: 100
|
||||
},
|
||||
overlay: {
|
||||
type: Boolean,
|
||||
value: true
|
||||
},
|
||||
closeIcon: {
|
||||
type: String,
|
||||
value: 'cross'
|
||||
},
|
||||
closeIconPosition: {
|
||||
type: String,
|
||||
value: 'top-right'
|
||||
},
|
||||
closeOnClickOverlay: {
|
||||
type: Boolean,
|
||||
value: true
|
||||
},
|
||||
position: {
|
||||
type: String,
|
||||
value: 'center',
|
||||
observer: 'observeClass'
|
||||
},
|
||||
safeAreaInsetBottom: {
|
||||
type: Boolean,
|
||||
value: true
|
||||
},
|
||||
safeAreaInsetTop: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.observeClass();
|
||||
},
|
||||
methods: {
|
||||
onClickCloseIcon() {
|
||||
this.$emit('close');
|
||||
},
|
||||
onClickOverlay() {
|
||||
this.$emit('click-overlay');
|
||||
if (this.data.closeOnClickOverlay) {
|
||||
this.$emit('close');
|
||||
}
|
||||
},
|
||||
observeClass() {
|
||||
const { transition, position } = this.data;
|
||||
const updateData = {
|
||||
name: transition || position
|
||||
};
|
||||
if (transition === 'none') {
|
||||
updateData.duration = 0;
|
||||
}
|
||||
this.setData(updateData);
|
||||
}
|
||||
}
|
||||
});
|
||||
import { VantComponent } from '../common/component';
|
||||
import { transition } from '../mixins/transition';
|
||||
VantComponent({
|
||||
classes: [
|
||||
'enter-class',
|
||||
'enter-active-class',
|
||||
'enter-to-class',
|
||||
'leave-class',
|
||||
'leave-active-class',
|
||||
'leave-to-class'
|
||||
],
|
||||
mixins: [transition(false)],
|
||||
props: {
|
||||
round: Boolean,
|
||||
closeable: Boolean,
|
||||
customStyle: String,
|
||||
overlayStyle: String,
|
||||
transition: {
|
||||
type: String,
|
||||
observer: 'observeClass'
|
||||
},
|
||||
zIndex: {
|
||||
type: Number,
|
||||
value: 100
|
||||
},
|
||||
overlay: {
|
||||
type: Boolean,
|
||||
value: true
|
||||
},
|
||||
closeIcon: {
|
||||
type: String,
|
||||
value: 'cross'
|
||||
},
|
||||
closeIconPosition: {
|
||||
type: String,
|
||||
value: 'top-right'
|
||||
},
|
||||
closeOnClickOverlay: {
|
||||
type: Boolean,
|
||||
value: true
|
||||
},
|
||||
position: {
|
||||
type: String,
|
||||
value: 'center',
|
||||
observer: 'observeClass'
|
||||
},
|
||||
safeAreaInsetBottom: {
|
||||
type: Boolean,
|
||||
value: true
|
||||
},
|
||||
safeAreaInsetTop: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.observeClass();
|
||||
},
|
||||
methods: {
|
||||
onClickCloseIcon() {
|
||||
this.$emit('close');
|
||||
},
|
||||
onClickOverlay() {
|
||||
this.$emit('click-overlay');
|
||||
if (this.data.closeOnClickOverlay) {
|
||||
this.$emit('close');
|
||||
}
|
||||
},
|
||||
observeClass() {
|
||||
const { transition, position } = this.data;
|
||||
const updateData = {
|
||||
name: transition || position
|
||||
};
|
||||
if (transition === 'none') {
|
||||
updateData.duration = 0;
|
||||
}
|
||||
this.setData(updateData);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
14
utils/dist/popup/index.json
vendored
14
utils/dist/popup/index.json
vendored
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"van-icon": "../icon/index",
|
||||
"van-overlay": "../overlay/index"
|
||||
}
|
||||
}
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"van-icon": "../icon/index",
|
||||
"van-overlay": "../overlay/index"
|
||||
}
|
||||
}
|
||||
|
||||
48
utils/dist/popup/index.wxml
vendored
48
utils/dist/popup/index.wxml
vendored
@@ -1,24 +1,24 @@
|
||||
<wxs src="../wxs/utils.wxs" module="utils" />
|
||||
|
||||
<van-overlay
|
||||
wx:if="{{ overlay }}"
|
||||
show="{{ show }}"
|
||||
z-index="{{ zIndex }}"
|
||||
custom-style="{{ overlayStyle }}"
|
||||
duration="{{ duration }}"
|
||||
bind:click="onClickOverlay"
|
||||
/>
|
||||
<view
|
||||
wx:if="{{ inited }}"
|
||||
class="custom-class {{ classes }} {{ utils.bem('popup', [position, { round, safe: safeAreaInsetBottom, safeTop: safeAreaInsetTop }]) }}"
|
||||
style="z-index: {{ zIndex }}; -webkit-transition-duration:{{ currentDuration }}ms; transition-duration:{{ currentDuration }}ms; {{ display ? '' : 'display: none;' }};{{ customStyle }}"
|
||||
bind:transitionend="onTransitionEnd"
|
||||
>
|
||||
<slot />
|
||||
<van-icon
|
||||
wx:if="{{ closeable }}"
|
||||
name="{{ closeIcon }}"
|
||||
class="van-popup__close-icon van-popup__close-icon--{{ closeIconPosition }}"
|
||||
bind:tap="onClickCloseIcon"
|
||||
/>
|
||||
</view>
|
||||
<wxs src="../wxs/utils.wxs" module="utils" />
|
||||
|
||||
<van-overlay
|
||||
wx:if="{{ overlay }}"
|
||||
show="{{ show }}"
|
||||
z-index="{{ zIndex }}"
|
||||
custom-style="{{ overlayStyle }}"
|
||||
duration="{{ duration }}"
|
||||
bind:click="onClickOverlay"
|
||||
/>
|
||||
<view
|
||||
wx:if="{{ inited }}"
|
||||
class="custom-class {{ classes }} {{ utils.bem('popup', [position, { round, safe: safeAreaInsetBottom, safeTop: safeAreaInsetTop }]) }}"
|
||||
style="z-index: {{ zIndex }}; -webkit-transition-duration:{{ currentDuration }}ms; transition-duration:{{ currentDuration }}ms; {{ display ? '' : 'display: none;' }};{{ customStyle }}"
|
||||
bind:transitionend="onTransitionEnd"
|
||||
>
|
||||
<slot />
|
||||
<van-icon
|
||||
wx:if="{{ closeable }}"
|
||||
name="{{ closeIcon }}"
|
||||
class="van-popup__close-icon van-popup__close-icon--{{ closeIconPosition }}"
|
||||
bind:tap="onClickCloseIcon"
|
||||
/>
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user