使用main.ts时不能使用import语句。我有一个./storybook/babel.config.json
{
"presets": [
"@babel/preset-typescript",
["@babel/preset-env", { "shippedProposals": true, "targets": { "node": "current" } }],
"@babel/preset-react",
[
"@emotion/babel-preset-css-prop",
{
"sourceMap": false,
"autoLabel": "never",
"labelFormat": "[filename]--[local]"
}
]
]
}
Run Code Online (Sandbox Code Playgroud)
.storybook/tsconfig.json:
{
"target": "es2020",
"module": "esnext",
"strict": true,
"allowSyntheticDefaultImports": true,
"allowJs": true,
"esModuleInterop": true,
"noEmit": true,
"moduleResolution": "node",
"jsx": "preserve",
}
Run Code Online (Sandbox Code Playgroud)
在我的 .storybook/main.ts 中
import path from 'path'
export default {
core: {
builder: 'webpack5',
},
tsDocgenLoaderOptions: {
tsconfigPath: path.resolve(__dirname, '../tsconfig.json'),
},
typescript: {
reactDocgen: 'react-docgen-typescript',
},
stories: ['../src/**/__stories__/*.stories.tsx', '../src/__stories__/**'], …Run Code Online (Sandbox Code Playgroud) 我遇到一个问题,我无法在资源中获取表单,变量始终为空
我的资源:
@POST
@Path("/upload-logo")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(MediaType.TEXT_PLAIN)
public String uploadLogo (@MultipartForm LogoMultipartForm logoMultipartForm) throws IOException {
return this.companyService.uploadLogo(username, logoMultipartForm.logo);
}
Run Code Online (Sandbox Code Playgroud)
表格模型
public class LogoMultipartForm {
@FormParam("logo")
public byte[] logo;
@FormParam("filename")
@PartType("text/plain")
public String fileName;
}
Run Code Online (Sandbox Code Playgroud)
我的获取请求:
uploadLogo: async (file: File) => {
const form = new FormData();
form.append("logo", file, "logo.png");
form.append("filename", "test");
const { query, abort } = HttpClient.POST(`${COMPANY_URL}/upload-logo`, form);
let promise = query
.then((res: any) => {
console.log("Response", res);
if (res.status === 200) {
return res.text();
} else {
throw …Run Code Online (Sandbox Code Playgroud) 我没有找到有关扩展 quarkus-keycloak-admin-client 的指南。
我的 Quarkus 版本:1.8.1.Final
有人有资源可以提供一些有关如何使用此扩展的示例吗?