remaxjs / remax

使用真正的 React 构建跨平台小程序
https://remaxjs.github.io/remax/
MIT License
4.57k stars 364 forks source link

[BUG] 目前的F2-WX的官方描述无法使用 #1920

Closed BenLampson closed 2 years ago

BenLampson commented 2 years ago

bug 描述 尝试使用remax+f2-wx开发chart

复现步骤 使用CLI创建ts模板的remax空项目

$ npx create-remax-app my-app-ts -t
$ cd my-app-ts && npm i

按照官方描述,安装f2-wx 指导URL:url

# 安装 F2 依赖
npm i @antv/f2 --save 

# 微信小程序
npm i @antv/f2-wx --save

使用TS方式配置tsconfig.json

{
  "compilerOptions": {
    "target": "ESNext",
    "module": "ESNext",
    "moduleResolution": "node",
    "strict": true,
    "esModuleInterop": true,
    "jsx": "preserve",
    "rootDir": "src",
    "jsxFactory": "jsx",
    "jsxFragmentFactory": "Fragment",
    "baseUrl": "./",
    "paths": {
      "@/*": ["./src/*"]
    },
    "lib": ["DOM", "ES2015"]
  },
  "include": ["src/**/*", "typings/**/*"]
}

最终package.json内容为:

 {
  "name": "my-app-ts",
  "private": true,
  "version": "1.0.0",
  "description": "Remax Project With TypeScript",
  "main": "index.js",
  "keywords": [],
  "author": "Fat Person <58603432@qq.com>",
  "license": "MIT",
  "scripts": {
    "dev": "remax build -w -t",
    "build": "cross-env NODE_ENV=production remax build -t"
  },
  "dependencies": {
    "@antv/f2": "^4.0.22",
    "@antv/f2-wx": "^4.0.22",
    "react": "^16.14.0",
    "react-dom": "^16.14.0",
    "remax": "^2.9.1"
  },
  "devDependencies": {
    "@types/react": "^16.14.2",
    "cross-env": "^7.0.2",
    "typescript": "^4.1.2"
  }
}

期望结果 能够运行

复现代码 rep

版本信息:

其他信息

[ app.json 文件内容错误] app.json: ["usingComponents"]["f2"]: "@antv/f2-wx" 未找到(env: Windows,mp,1.05.2203070; lib: 2.24.5)
watsonhaw5566 commented 2 years ago

安装 wx-f2 的版本 就可以了,你有空再试试

BenLampson commented 2 years ago

安装 wx-f2 的版本 就可以了,你有空再试试

您指的是只需要单独安装wx-f2是吗,我尝试一下,谢谢您的回复

watsonhaw5566 commented 2 years ago

安装 wx-f2 的版本 就可以了,你有空再试试

您指的是只需要单独安装wx-f2是吗,我尝试一下,谢谢您的回复

对的,您再试试

BenLampson commented 2 years ago

谢谢您的回复.已经处理