docs(Overlay): add embedded content demo (#4982)

This commit is contained in:
neverland
2019-11-11 20:52:37 +08:00
committed by GitHub
parent 9d12e895fe
commit 2c6b5408d3
4 changed files with 97 additions and 3 deletions
+38 -3
View File
@@ -10,6 +10,21 @@
<van-overlay :show="show" @click="show = false" />
</demo-block>
<demo-block :title="$t('embeddedContent')">
<van-button
type="primary"
:text="$t('embeddedContent')"
style="margin-left: 16px;"
@click="showEmbedded = true"
/>
<van-overlay :show="showEmbedded" @click="showEmbedded = false">
<div class="wrapper">
<div class="block" />
</div>
</van-overlay>
</demo-block>
</demo-section>
</template>
@@ -17,17 +32,37 @@
export default {
i18n: {
'zh-CN': {
showOverlay: '显示遮罩层'
showOverlay: '显示遮罩层',
embeddedContent: '嵌入内容'
},
'en-US': {
showOverlay: 'Show Overlay'
showOverlay: 'Show Overlay',
embeddedContent: 'Embedded Content'
}
},
data() {
return {
show: false
show: false,
showEmbedded: false
};
}
};
</script>
<style lang="less">
.demo-overlay {
.wrapper {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
.block {
width: 120px;
height: 120px;
background-color: #fff;
}
}
</style>