1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <template>
- <view class="empty-content">
- <image class="emptyImg" src="@/static/empty.png"></image>
- <p class="tip">{{text}}</p>
- <button type="primary" class="addBtn" v-if="showBtn" @click="handleAdd">新增</button>
- </view>
- </template>
- <script>
- export default {
- name: "empty",
- props: {
- text: {
- default: '暂无数据',
- type: String,
- },
- showBtn: {
- default: false,
- type: Boolean,
- },
- },
- data() {
- return {
- };
- },
- methods: {
- handleAdd() {
- this.$emit('onAdd')
- },
- },
- }
- </script>
- <style lang="scss" scoped>
- .empty-content {
- width: 70%;
- margin-left: 15%;
- margin-top: 40%;
- text-align: center;
- .emptyImg {
- width: 100%;
- }
- .tip {
- font-size: 36rpx;
- color: #666;
- }
- .addBtn {
- width: 40%;
- margin-top: 32rpx;
- }
- }
- </style>
|