antvis / wx-f2

F2 的微信小程序
MIT License
1.28k stars 185 forks source link

在小程序中无法使用 #372

Open JunHaoZhou1 opened 2 years ago

JunHaoZhou1 commented 2 years ago

尊敬的开源者,您好,我在使用你开源的项目中出现了问题,按照文档提供的步骤一步一步操作还是无法实现,不知是不是我自己的问题,还望看到能及时回复,感谢。下面附上问题和截图~!

我是按照文档提供的引入babel.config方式,但是他的编译好像没有达到。不太清楚是哪里的问题

JunHaoZhou1 commented 2 years ago

没办法添加截图

JunHaoZhou1 commented 2 years ago

{ "classic": { "plugins": [ [ "@babel/plugin-transform-react-jsx", { "pragma": "jsx", "pragmaFrag": "Fragment" } ] ] }, "automatic": { "plugins": [ [ "@babel/plugin-transform-react-jsx", { "runtime": "automatic", "importSource": "@antv/f2" } ] ] } }

JunHaoZhou1 commented 2 years ago

这是jsx内容 import Chart from './chart';

const data = [ { genre: 'Sports', sold: 275 }, { genre: 'Strategy', sold: 115 }, { genre: 'Action', sold: 120 }, { genre: 'Shooter', sold: 350 }, { genre: 'Other', sold: 150 }, ];

Page({ data: { onRenderChart() { return ; }, }, });

JunHaoZhou1 commented 2 years ago

这是编译后的内容,缺少 // pages/index/index.js Page({

/**