123456789101112131415161718192021222324252627282930313233343536 |
- <template>
- <div>
- <van-empty :image="imageSrc" :description="description" v-if="imageSrc" />
- <van-empty :description="description" v-else />
- </div>
- </template>
- <script>
- import { mapGetters } from 'vuex'
- export default {
- name: 'simple-empty',
- props: {
- image: {
- type: String,
- default: '',
- },
- name: {
- type: String,
- default: '',
- },
- description: {
- type: String,
- default: '描述文字',
- },
- },
- computed: {
- ...mapGetters(['static']),
- imageSrc() {
- if (this.image) return this.image
- if (this.name) return this.static + '/' + this.name
- return ''
- },
- },
- }
- </script>
|