微信小程序-weui-antv使用

使用小程序发现组件使用引入总是报错 就删除包重新安装
构建npm包

1.npm init -y
2.npm install --save weui-miniprogram

到工具-构建npm

3.app.wxss中引入

@import '/miniprogram_npm/weui-miniprogram/weui-wxss/dist/style/weui.wxss';

使用除了基础组件以外的组件时候单独引用

 "usingComponents": {
    "mp-tabs": "@miniprogram-component-plus/tabs",
  }

徽标使用

<mp-badge style="margin-left: 5px;margin-right: 5px;" ext-class="red" content="{{followed}}"/>//followed内容

单独引入:

  "usingComponents": {
    "mp-badge": "weui-miniprogram/badge/badge"
  }

vantv使用

1.npm install @antv/wx-f2 --save
2. "usingComponents": {
    "f2": "@antv/wx-f2"
  }

3.使用

4.实例化// 实例化图标

  onInitChart(F2, config) {
      const chart = new F2.Chart(config);
      const data = [
        { value: 63.4, city: 'New York', date: '2011-10-01' },
        { value: 62.7, city: 'Alaska', date: '2011-10-01' },
        { value: 72.2, city: 'Austin', date: '2011-10-01' },
      ];
      chart.source(data, {
        date: {
          range: [0, 1],
          type: 'timeCat',
          mask: 'MM-DD'
        },
        value: {
          max: 300,
          tickCount: 4
        }
      });
      chart.area().position('date*value').color('city').adjust('stack');
      chart.line().position('date*value').color('city').adjust('stack');
      chart.render();
      // 注意:需要把chart return 出来
      return chart;
    }
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

大白菜1号

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值