先上效果图:
这里使用的是vue2.0。
npm install echarts 安装echarts后将其挂在在vue上,在main.js中进行操作
// 全局引入Echarts
import * as echarts from "echarts";
// 然后挂载在vue原型上
Vue.prototype.$echarts = echarts;
全部代码:
<template>
<div>
<div class="all">
<div
:class="[animation ? 'aaa' : '']"
id="per"
style="height: 700px; width: 700px"
></div>
<div
:class="[animation2 ? 'bbb' : '']"
id="per2"
style="
height: 700px;
width: 700px;
transform: rotateX(90deg);
"
></div>
</div>
<el-button type="primary" @click="setAnimation">z转动</el-button>
<el-button type="primary" @click="setAnimationX">X转动</el-button>
</div>
</template>
<script>
export default {
data() {
return {
option: {
// title: {