From c3cf74cda028b4cec68c7465fcdf8a66e0f1d246 Mon Sep 17 00:00:00 2001 From: neverland Date: Tue, 26 Feb 2019 19:31:23 +0800 Subject: [PATCH] [bugfix] Actionsheet: get-container not work (#2853) --- packages/actionsheet/index.tsx | 1 + packages/actionsheet/test/index.spec.js | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/packages/actionsheet/index.tsx b/packages/actionsheet/index.tsx index e0bac3c54..8d5898717 100644 --- a/packages/actionsheet/index.tsx +++ b/packages/actionsheet/index.tsx @@ -92,6 +92,7 @@ function Actionsheet( position="bottom" overlay={props.overlay} lazyRender={props.lazyRender} + getContainer={props.getContainer} closeOnClickOverlay={props.closeOnClickOverlay} onInput={(value: boolean) => { emit(ctx, 'input', value); diff --git a/packages/actionsheet/test/index.spec.js b/packages/actionsheet/test/index.spec.js index dcb7e8c06..6d209c27b 100644 --- a/packages/actionsheet/test/index.spec.js +++ b/packages/actionsheet/test/index.spec.js @@ -52,3 +52,14 @@ test('disable lazy-render', () => { expect(wrapper).toMatchSnapshot(); }); + +test('get container', () => { + const wrapper = mount(Actionsheet, { + propsData: { + value: true, + getContainer: 'body' + } + }); + + expect(wrapper.vm.$el.parentNode).toEqual(document.body); +});