From 8efd4f6dbd7a687b783c60c249014759f4b601b3 Mon Sep 17 00:00:00 2001 From: Mac Date: Thu, 16 Mar 2017 13:48:05 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=B1=E4=BA=8E=E5=9C=A8=E5=8F=91=E5=8C=85?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E6=89=BE=E4=B8=8D=E5=88=B0=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=EF=BC=8C=E7=8E=B0=E5=B0=86=20=20source=3D{require('./tpl.html'?= =?UTF-8?q?)}=E6=94=B9=E4=B8=BAsource=3D{this.props.source}=EF=BC=8C?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E7=94=B1=E5=A4=96=E9=83=A8=E4=BC=A0=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Echarts/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/Echarts/index.js b/src/components/Echarts/index.js index c0e23bd..0247205 100644 --- a/src/components/Echarts/index.js +++ b/src/components/Echarts/index.js @@ -10,6 +10,9 @@ export default class App extends Component { } } + //由于在发包时,找不到模板,现将 + //source={require('./tpl.html')}改为source={this.props.source} + //模板由外部传入 render() { return ( @@ -20,7 +23,7 @@ export default class App extends Component { style={{ height: this.props.height || 400, }} - source={require('./tpl.html')} + source={this.props.source} /> );