forked from devsam/core
- eslint에 prettier 조합 - prettierrc에 width 120, tabWidth 2 - gameStor->map_theme 제거 - map_theme, mapTheme를 GameConst::$mapName으로 대체 - eslint에서 vue/vue3-essential 대신 vue3-recommended 적용 - vue/max-attributes-per-line 완화 - vue/v-on-event-hyphenation 해제 - vue/attribute-hyphenation 해제 - 일부 tsc import type warning 해결 - 일부 vue template type warning 해결 - 일부 vue SFC를 script setup으로 변경 - TipTap - TopBackBar - BottomBackBar - BoardArticle - ProcessCity
74 lines
1.9 KiB
Vue
74 lines
1.9 KiB
Vue
<template>
|
|
<TopBackBar :title="commandName" />
|
|
<div class="bg0">
|
|
<div>자신의 군량을 사거나 팝니다.<br /></div>
|
|
<div class="row">
|
|
<div class="col-2 col-md-1">
|
|
군량을 :
|
|
<b-button-group>
|
|
<b-button :pressed="buyRice" @click="buyRice = true"> 삼 </b-button>
|
|
<b-button :pressed="!buyRice" @click="buyRice = false"> 팜 </b-button>
|
|
</b-button-group>
|
|
</div>
|
|
<div class="col-7 col-md-4">
|
|
금액 :
|
|
<SelectAmount v-model="amount" :amountGuide="amountGuide" :maxAmount="maxAmount" :minAmount="minAmount" />
|
|
</div>
|
|
<div class="col-3 col-md-2 d-grid">
|
|
<b-button variant="primary" @click="submit">
|
|
{{ commandName }}
|
|
</b-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<BottomBar :title="commandName" />
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import SelectAmount from "@/processing/SelectAmount.vue";
|
|
import { defineComponent, ref } from "vue";
|
|
import { unwrap } from "@/util/unwrap";
|
|
import type { Args } from "@/processing/args";
|
|
import TopBackBar from "@/components/TopBackBar.vue";
|
|
import BottomBar from "@/components/BottomBar.vue";
|
|
declare const commandName: string;
|
|
|
|
declare const procRes: {
|
|
minAmount: number;
|
|
maxAmount: number;
|
|
amountGuide: number[];
|
|
};
|
|
|
|
export default defineComponent({
|
|
components: {
|
|
SelectAmount,
|
|
TopBackBar,
|
|
BottomBar,
|
|
},
|
|
setup() {
|
|
const amount = ref(1000);
|
|
const buyRice = ref(true);
|
|
|
|
async function submit(e: Event) {
|
|
const event = new CustomEvent<Args>("customSubmit", {
|
|
detail: {
|
|
amount: amount.value,
|
|
buyRice: buyRice.value,
|
|
},
|
|
});
|
|
unwrap(e.target).dispatchEvent(event);
|
|
}
|
|
|
|
return {
|
|
buyRice,
|
|
amount,
|
|
minAmount: ref(procRes.minAmount),
|
|
maxAmount: ref(procRes.maxAmount),
|
|
amountGuide: procRes.amountGuide,
|
|
commandName,
|
|
submit,
|
|
};
|
|
},
|
|
});
|
|
</script>
|