feat: add popover component

This commit is contained in:
chenjiahan
2020-11-16 20:49:46 +08:00
committed by neverland
parent cd6ce609f5
commit 8f5a84ceec
10 changed files with 389 additions and 0 deletions

View File

@@ -0,0 +1,60 @@
<template>
<demo-section>
<demo-block :title="t('basicUsage')">
<van-popover
v-model="show.basic"
:actions="t('actions')"
placement="bottom-left"
>
<van-button @click="show.basic = true">
{{ t('showPopover') }}
</van-button>
</van-popover>
</demo-block>
<demo-block :title="t('lightTheme')">
<van-popover
v-model="show.lightTheme"
theme="light"
:actions="t('actions')"
placement="bottom-left"
>
<van-button @click="show.lightTheme = true">
{{ t('lightTheme') }}
</van-button>
</van-popover>
</demo-block>
</demo-section>
</template>
<script>
export default {
i18n: {
'zh-CN': {
actions: [{ text: '文本' }, { text: '文本' }, { text: '文本' }],
lightTheme: '浅色风格',
showPopover: '点击弹出气泡',
},
'en-US': {
actions: [{ text: 'Text' }, { text: 'Text' }, { text: 'Text' }],
lightTheme: 'Light Theme',
showPopover: 'Show Popover',
},
},
data() {
return {
show: {
basic: false,
lightTheme: false,
},
};
},
methods: {},
};
</script>
<style lang="less">
@import '../../style/var';
</style>