1.0.0 • Published 2 years ago

sheng-table-search v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

element ui 的搜索组件

<page-search class="mt16"
             :btnItems="btnItems"
             :formOptions="formOptions"
             @onInquire="onInquire"
             @onReset="onReset">
</page-search>
data(){
    const changeFunction = (val, key) => {
        this.search[key] = val
    }
    return{
         btnItems: 'inquire,reset',
         formOptions: [
            {
            label: '',
            prop: 'keyword',
            element: 'el-input',
            show: true,
            placeholder: '输入评论ID',
            events: {
                change (val) {
                changeFunction(val, 'keyword')
                }
            }
            },
            {
            label: '发布时间',
            prop: 'date',
            element: 'el-date-picker',
            valueFormat: 'timestamp',
            type: 'daterange',
            clearable: true,
            events: {
                change (val) {
                changeFunction(val, 'date')
                }
            }
            },
            {
            label: '状态',
            prop: 'status',
            element: 'el-select',
            placeholder: '全部',
            value: '',
            options: [{ name: '已发布', id: 1 }, { name: '已删除', id: -1 }],
            clearable: true,
            events: {
                change (val) {
                changeFunction(val, 'status')
                }
            },
            style: {
                width: '120px'
            }
            }
        ],
    }
}