Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

列表配置展开项及默认展开行 #95

Open
EdwardQ opened this issue Dec 26, 2019 · 1 comment
Open

列表配置展开项及默认展开行 #95

EdwardQ opened this issue Dec 26, 2019 · 1 comment

Comments

@EdwardQ
Copy link

EdwardQ commented Dec 26, 2019

No description provided.

@EdwardQ
Copy link
Author

EdwardQ commented Dec 30, 2019

1、可通过配置列表的expand: {}来展开表单的字段
2、默认展开项需要通过props['row-key']和props.['expand-row-keys']来实现

{
    type: 'list',
    ...
    // 配置展开表单展示的字段
    expand: {
        id: true,
        testText: true,
        testTextarea: true,
        testDate: true,
        testSwitch: true
    },
    // 设置展开项
    props: {
        // 设置每行的rowkey为当前行的id
        'row-key': function(row) {
            return row.id
        },
        'expand-row-keys': []
    },
    events: {
        init: '@list @setExpandRow'
    },
    actions: {
        setExpandRow() {
            // 设置默认展开行
            this.block.props['expand-row-keys'] = ['2']
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant