fix: hide type tabs when embedded in home page

This commit is contained in:
2026-07-17 13:41:29 +08:00
parent 0bd32a1549
commit 5e998b2201
2 changed files with 4 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
const TicketCreate = {
files: [],
render(container, { type, prefill, backLink }) {
render(container, { type, prefill, backLink, hideTabs }) {
const user = Auth.user();
const isReport = type === 'report';
const isSuggestion = type === 'suggestion';
@@ -10,11 +10,11 @@ const TicketCreate = {
this.files = [];
container.innerHTML = `
<div class="tab-nav" id="type-tabs">
${hideTabs ? '' : `<div class="tab-nav" id="type-tabs">
<button class="${isReport?'active':''}" data-type="report">举报</button>
<button class="${isSuggestion?'active':''}" data-type="suggestion">建议</button>
<button class="${isAppeal?'active':''}" data-type="appeal">申诉</button>
</div>
</div>`}
<form id="ticket-form" enctype="multipart/form-data">
<input type="hidden" name="type" value="${type}">