Closed osdebianly closed 7 years ago
使用 Webpack 1 的话,可以参考 README 这里。vue-cli
默认生成的配置把 node_modules
排除了,你引用里面的 ES Next 源文件当然就失败了。
无法设置主题是指?
<echart class="echarts" :options="option" theme="macarons" ></echart>
设置了主题 但是 没有效果
有没有 import 'echarts/theme/macarons'
呢?
import VueECharts from 'vue-echarts'
import 'echarts/theme/macarons.js'
//import VueECharts from 'vue-echarts/components/ECharts.vue'
Vue.component('echart', VueECharts);
加上后,主题并没有改变
参考 README ,使用import VueECharts from 'vue-echarts/components/ECharts.vue'
{
test: /\.js$/,
loader: 'babel',
include: [
path.join(__dirname, 'src'),
path.join(__dirname, 'node_modules/vue-echarts')
],
exclude: /node_modules(?![\\/]vue-echarts[\\/])/
}
还是一样错误
import Vue from 'vue'
import ECharts from 'vue-echarts/components/ECharts.vue'
import 'echarts/theme/dark'
// registering component
Vue.component('chart', ECharts)
这样呢?
还是一样,折腾累了,由于只是画简单线条,用了 vue-charts, 最后感谢您的回复
可以关闭这个issues
使用 webpack 打包出错
已配置
使用
import VueECharts from 'vue-echarts'
编译通过,页面显示正常,但是无法设置主题