该组件用于在一个页面中展示订单详情,包括订单状态、支付金额、商品数量等信息。
该组件提供了以下基本功能:
const activeOrder = ref("Rp 32.000");
const monitor = ref("1 pc");
const arepVHS = ref("1 kg");
const totalPrice = ref("Rp 32.000");
const availableOrder = ref("Rp 32.000");
使用 Vue.js 的 ref
钩子初始化组件状态,用于存储订单详情。
import * as echarts from 'echarts';
import { h } from "vue";
import { createComponent } from 'echarts-for-vue';
const ECharts = createComponent({echarts, h});
导入 ECharts 库并使用 createComponent
函数创建 ECharts 组件。
<template>
<div class="bg-gray-100">
<van-nav-bar title="Pesanan" left-arrow fixed :border-bottom="false" />
<div class="py-4 px-3">
<van-cell-group>
<van-cell title="Pilih Aktif" is-link :value="activeOrder" />
<van-cell title="Monitor" is-link :value="monitor" />
<van-cell title="Arep VHS" is-link :value="arepVHS" />
<van-cell title="Total Pembayaran" :value="totalPrice" />
</van-cell-group>
<van-divider />
<van-cell-group>
<van-cell title="Pilih Tersedia" is-link :value="availableOrder" />
<van-cell title="Monitor" is-link :value="monitor" />
<van-cell title="Arep VHS" is-link :value="arepVHS" />
<van-cell title="Total Pembayaran" :value="totalPrice" />
</van-cell-group>
</div>
</div>
</template>
使用 Vue.js 模板语法渲染订单详情,包括订单状态、商品数量和总支付金额。