我的修改器有问题navigationBarBackButtonHidden。它不会隐藏导航后退按钮...
这是列表的源代码:
import SwiftUI
struct ContentView: View {
@State var showSheet = false
var body: some View {
NavigationView {
List(chatsData, id: \.self.id) { chat in
NavigationLink(destination: ChatView(chat: chat)) {
ChatRow(chat: chat)
}
}
.navigationBarTitle("Chats")
}
}
}
Run Code Online (Sandbox Code Playgroud)
这是我希望隐藏“默认”后退按钮的视图的代码:
import SwiftUI
struct ChatView: View {
var chat: Chat
@Environment(\.presentationMode) var presentationMode: Binding<PresentationMode>
@State var name: String = "Some text"
fileprivate var backButton: some View {
Button(action: {
self.presentationMode.wrappedValue.dismiss()
}, label: {
Image(systemName: "chevron.left")
})
}
var body: …Run Code Online (Sandbox Code Playgroud) 我的 docker-compose 配置文件有问题。我的目标是使用 docker-compose 文件运行 Next.js 应用程序并启用热重载。
从 Dockerfile 运行 Next.js 应用程序可以工作,但热重载不起作用。从 docker-compose 文件运行 Next.js 应用程序会触发错误:/bin/sh: next: not found并且我无法弄清楚出了什么问题......
Dockerfile:(取自 Next.js 的文档网站)[但请注意,这是一个多阶段构建,我仅引用builderdocker-compose 文件中的阶段。]
# Install dependencies only when needed
FROM node:18-alpine AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install # --frozen-lockfile
# Rebuild the source code only when needed
FROM node:18-alpine AS builder
WORKDIR /app
COPY …Run Code Online (Sandbox Code Playgroud)