1.0.4 • Published 1 year ago

vueact-searcher v1.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago
new Searcher(element, {
    placeholder: `请选择条件 .`,
    options: [
        {
            label: `应用`,
            value: 'appId',
            type: SearcherType.MENUS,
            current: [],
            store: async (name: string) =>
                Promise.resolve([
                    { label: 'Test 1', value: 'Test 1' },
                    { label: 'Test 2', value: 'Test 2' },
                ]),
        },
        {
            label: `单选`,
            value: 'only',
            type: SearcherType.MENU,
            store: async (name: string) =>
                Promise.resolve([
                    { label: 'Test 1', value: 'Test 1' },
                    { label: 'Test 2', value: 'Test 2' },
                ]),
        },
        {
            label: `关键字`,
            value: 'keywords',
            type: SearcherType.TAGS,
            current: [],
            props: { placeholder: '请填写关键字' },
        },
        { label: `输入框`, value: 'input', type: SearcherType.INPUT },
        {
            label: `下拉`,
            value: 'select',
            type: SearcherType.SELECT,
            store: async (name: string) =>
                Promise.resolve([
                    { label: 'Test 1', value: 'Test 1' },
                    { label: 'Test 2', value: 'Test 2' },
                ]),
        },
        {
            label: `多下拉`,
            value: 'selects',
            type: SearcherType.SELECTS,
            current: [],
            store: async (name: string) =>
                Promise.resolve([
                    { label: 'Test 1', value: 'Test 1' },
                    { label: 'Test 2', value: 'Test 2' },
                ]),
        },
        {
            label: `时间`,
            value: 'timerange',
            type: SearcherType.DATAPICKER,
            current: [],
        },
    ],
    onChange: (config) => {
        console.log(11111111, config);
    },
});