Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在小程序中无法使用 #372

Open
JunHaoZhou1 opened this issue Sep 20, 2022 · 4 comments
Open

在小程序中无法使用 #372

JunHaoZhou1 opened this issue Sep 20, 2022 · 4 comments

Comments

@JunHaoZhou1
Copy link

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

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

@JunHaoZhou1
Copy link
Author

没办法添加截图

@JunHaoZhou1
Copy link
Author

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

@JunHaoZhou1
Copy link
Author

这是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
Copy link
Author

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

/**

  • 页面的初始数据
    */
    data: {

},

/**

  • 生命周期函数--监听页面加载
    */
    onLoad(options) {

},

/**

  • 生命周期函数--监听页面初次渲染完成
    */
    onReady() {

},

/**

  • 生命周期函数--监听页面显示
    */
    onShow() {

},

/**

  • 生命周期函数--监听页面隐藏
    */
    onHide() {

},

/**

  • 生命周期函数--监听页面卸载
    */
    onUnload() {

},

/**

  • 页面相关事件处理函数--监听用户下拉动作
    */
    onPullDownRefresh() {

},

/**

  • 页面上拉触底事件的处理函数
    */
    onReachBottom() {

},

/**

  • 用户点击右上角分享
    */
    onShareAppMessage() {

}
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant