"use strict";
const common_vendor = require("../../common/vendor.js");
const _sfc_main = {
  data() {
    return {
      menuItems: [
        { name: "牛肉面", price: 18 },
        { name: "炒饭", price: 15 }
      ],
      cart: []
    };
  },
  methods: {
    addToCart(item) {
      this.cart.push({ ...item });
    },
    removeFromCart(index) {
      this.cart.splice(index, 1);
    }
  }
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  return common_vendor.e({
    a: common_vendor.f($data.menuItems, (item, index, i0) => {
      return {
        a: common_vendor.t(item.name),
        b: common_vendor.t(item.price),
        c: common_vendor.o(($event) => $options.addToCart(item)),
        d: index
      };
    }),
    b: $data.cart.length > 0
  }, $data.cart.length > 0 ? {
    c: common_vendor.f($data.cart, (cartItem, cartIndex, i0) => {
      return {
        a: common_vendor.t(cartItem.name),
        b: common_vendor.t(cartItem.price),
        c: common_vendor.o(($event) => $options.removeFromCart(cartIndex)),
        d: cartIndex
      };
    })
  } : {});
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:/111111000000/uniapp04/pages/forums/forums.vue"]]);
my.createPage(MiniProgramPage);
