npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bo-table

v1.0.10

Published

``` npm i bo-table ```

Downloads

13

Readme

安装依赖

npm i bo-table

使用

  • 引用
import bTable from 'bTable'
Vue.use(bTable)
  • 创建表格
<!-- 如果需要自定义筛选列的功能,需要在组件上添加 
    :showHandle="true"
    @handle-column="((arr)=>{defaultHead = arr}) -->
<b-table :data="listData" :columns="defaultHead" :showsummary="true"></b-table>

<script>
  data(){
    return {
      // 列表数据
      listData: [],
      // 表头数据
      defaultHead: []
    }
  }
</script>

| 参数 | 类型 | 描述 | 是否必填 | 默认值 | | ---- | ---- | ---- | ---- | ---- | | data | Array | 表格要显示的数据 | ✗ | -- | | columns | Array | 展示列配置信息,如:[ {  type: "index",  minWidth: 80 }, {  prop: "name",  label: "姓名",  align: "center",  minWidth: "120",  fixed: "left",  sort: true,  // 可选值价格(price)、数量(num)  hj: "price",  // 多级表头需要设置child,内容与普通column相同  child: [], }] | ✗ | -- | | options | Object | 表格配置信息 | ✗ | {   stripe: true,  border: true,  lazy: false,  max_height: "",  highlightCurrentRow: false,  headerRowStyle: {  backgroundColor: "#f8f8f8" } } | | tableClass | String | table自定义类名 | ✗ | 'hxTable' | | showPage | Boolean | 是否展示分页 | ✗ | true | | page | Object | 分页数据;showPage=false时可默认不传 | ✓ | { total: 0, page: 1, perpage: 20} | | loading | Boolean | 表格区域的加载效果 | ✗ | false | | defaultSort | Object | 表格的默认排序 | ✗ | -- | | sortMethod | Function(a, b) | 对数据进行排序的时候使用的方法,仅当 sortable 设置为 true 的时候有效,需返回一个数字,和 Array.sort 表现一致 | ✗ | -- | | showsummary | Boolean | 是否显示表格合计行 | ✗ | false | | precision | Number | 合计行,价格精度-保留几位小数 | ✗ | 2 | | count_sum | Object | 手动传入合计数据,键名需与表格列prop相同 | ✗ | -- | | showHandle | Boolean | 是否显示表格上方显示区域, 默认有自定义筛选列功能 | ✗ | false |