diff --git a/packages/wujie-react/index.js b/packages/wujie-react/index.js index d957dd2d4..6410cde89 100644 --- a/packages/wujie-react/index.js +++ b/packages/wujie-react/index.js @@ -37,9 +37,9 @@ export default class WujieReact extends React.PureComponent { render() { this.execStartApp(); - const { width, height } = this.props; + const { width, height, style } = this.props; const { myRef: ref } = this.state; - return
; + return ; } } @@ -67,4 +67,5 @@ const propTypes = { activated: PropTypes.func, deactivated: PropTypes.func, loadError: PropTypes.func, + style: PropTypes.object } \ No newline at end of file diff --git a/packages/wujie-vue2/index.js b/packages/wujie-vue2/index.js index becc77664..4a6bbd1dc 100644 --- a/packages/wujie-vue2/index.js +++ b/packages/wujie-vue2/index.js @@ -1,5 +1,6 @@ import Vue from "vue"; import { bus, preloadApp, startApp as rawStartApp, destroyApp, setupApp } from "wujie"; +import CSS from 'csstype' const wujieVueOptions = { name: "WujieVue", @@ -27,6 +28,7 @@ const wujieVueOptions = { activated: { type: Function, default: null }, deactivated: { type: Function, default: null }, loadError: { type: Function, default: null }, + style: { type: CSS.Properties, default: {} }, }, data() { return { @@ -91,6 +93,7 @@ const wujieVueOptions = { style: { width: this.width, height: this.height, + ...this.style, }, ref: "wujie", }); diff --git a/packages/wujie-vue3/index.js b/packages/wujie-vue3/index.js index aade17513..15f60dcc2 100644 --- a/packages/wujie-vue3/index.js +++ b/packages/wujie-vue3/index.js @@ -1,5 +1,6 @@ import { bus, preloadApp, startApp as rawStartApp, destroyApp, setupApp } from "wujie"; import { h, defineComponent } from "vue"; +import CSS from 'csstype' const wujieVueOptions = { name: "WujieVue", @@ -27,6 +28,7 @@ const wujieVueOptions = { activated: { type: Function, default: null }, deactivated: { type: Function, default: null }, loadError: { type: Function, default: null }, + style: { type: CSS.Properties, default: {} }, }, data() { return { @@ -90,6 +92,7 @@ const wujieVueOptions = { style: { width: this.width, height: this.height, + ...this.style, }, ref: "wujie", });