mirror of
https://github.com/youzan/vant.git
synced 2025-10-18 17:51:54 +00:00
popup component demo
This commit is contained in:
19
docs/components/mobile-computed.js
Normal file
19
docs/components/mobile-computed.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import MobilePopup from 'components/mobile-popup.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
MobilePopup
|
||||
},
|
||||
|
||||
computed: {
|
||||
mobileUrl() {
|
||||
return '/examples.html' + location.hash;
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
mobileShow: false
|
||||
};
|
||||
}
|
||||
};
|
45
docs/components/mobile-popup.vue
Normal file
45
docs/components/mobile-popup.vue
Normal file
@@ -0,0 +1,45 @@
|
||||
<template>
|
||||
<zan-popup v-model="currentValue">
|
||||
<div class="mobile-popup">
|
||||
<iframe :src="url" class="mobile-popup-iframe"></iframe>
|
||||
</div>
|
||||
</zan-popup>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
url: String,
|
||||
value: {}
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
currentValue: this.value
|
||||
};
|
||||
},
|
||||
|
||||
watch: {
|
||||
currentValue(val) {
|
||||
this.$emit('input', val);
|
||||
},
|
||||
value(val) {
|
||||
console.log(val);
|
||||
this.currentValue = val;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.mobile-popup {
|
||||
width: 380px;
|
||||
height: 500px;
|
||||
border: 5px solid #e5e5e5;
|
||||
}
|
||||
|
||||
.mobile-popup-iframe {
|
||||
width: 100%;
|
||||
height: 500px;
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user