<template>
<a-drawer
title="为模板添加产品"
width="70%"
:visible="visible"
:body-style="{ paddingBottom: '80px' }"
@close="visible = false"
:maskClosable="false"
:keyboard="false"
>
<a-input v-model.lazy="searchGoodName" placeholder="搜索产品" allowClear>
<a-icon slot="prefix" type="search" />
</a-input>
<scroll-load class="scroll-load"></scroll-load>
<!-- 页脚 -->
<div
:style="{
position: 'absolute',
right: 0,
bottom: 0,
width: '100%',
borderTop: '1px solid #e9e9e9',
padding: '10px 16px',
background: '#fff',
textAlign: 'right',
zIndex: 1,
}"
>
<a-button :style="{ marginRight: '8px' }" @click="visible = false">取消</a-button>
<a-button type="primary" @click="handleOkClick">保存</a-button>
</div>
</a-drawer>
</template>
<script>
import scrollLoad from '@/components/ScrollLoad/index'
const columns = [
{ title: '序号', customRender: (text, record, index) => `${index + 1}`, fixed: 'left', width: 70, align: 'center' },
{
title: '产品主图',
dataIndex: 'image_link',
key: 'image_link',
scopedSlots: { customRender: 'image_link' },
width: 100,
},
{
title: '商品名',
dataIndex: 'goods_name',
key: 'goods_name',
},
]
export default {
name: 'AddGoods',
components: {
scrollLoad
},
data() {
return {
visible: false,
searchGoodName: '',
columns,
selectedRowKeys: []
}
},
computed: {
rowSelection() {
const _this = this
const { selectedRowKeys } = this
return {
selectedRowKeys,
onChange: (selectedRowKeys) => {
_this.selectedRowKeys = selectedRowKeys
},
}
},
},
methods: {
handleOkClick() {},
},
}
</script>
<style lang="stylus" scoped>
.scroll-load {
margin-top: 30px;
}
</style>
复制直接格式化一下就可以用