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

jk-felib

v1.1.9

Published

该类库用于链接FEApi接口,需要Vue运行环境支持。

Downloads

13

Readme

Felib 前后端组件类库

  • 该类库用于整合Feapi 后端接口,应用到Vue 前端项目中。

版本信息

v1.1.9

  • 修正入口index.js文件

v1.1.6

  • 完成npm 发布工作

v1.0.1

  • 主要完成接口请求的基础功能项目。

安装信息

通过NPM 安装类库

  • npm i jk-felib --save-dev

升级类库

  • npm update jk-felib --save-dev

使用方法

修改Vue 项目的main.js

  • vim main.js 编辑Vue项目的main.js 文件加入如下代码。
  • 注意api_request_url 是一个FEApi的请求地址,这个是根据实际情况变化的。
import feapi from "jk-felib"

// FEApi 接口请求组件,之后类中可以使用 this.$feapi 引用这个组件
Vue.use(felib, {
    // 配置API的请求接口
    feapiconf: {
        // 这个Mock 地址返回一个Feapi 数据格式中的成功状态
        api_request_url: "https://www.fastmock.site/mock/0a24fa68ebb6b2ab59e535eb08a3b2be/felib/fedata/success",
    }
})

通过 callApi() 项目中创建Feapi 请求

  • 这是一种相对基础的方法,其返回全部的Feapi 请求
// 写一个接口配置JSON
let config = {
    ic: "h200729",
    im: "get_curriculum_video_list",
    fps: {
        video_grouping_id: 1,
        start: 0,
        end: 10,
    },
    // 可选,默认是GET
    method: CKLFEApi.CONST_REQUEST_METHOD_IS_GET
}

this.$feapi.callApi(config).then((res)=>{
    // 请求正常进入这里
    console.log("请求成功::", res)
}).catch((err)=>{
    console.log(err)
})

//npm install --save-dev babel-cli 需要安装依赖

通过 successCallback() 创建Feapi 请求


this.$feapi.successCallback({
    ic: "h200729",
    im: "get_curriculum_video_list",
    fps: {
        video_grouping_id: this.groupobj.id,
        start: this.page_start,
        end: this.page_end,
    },
    method: 'get'
}).then((res) => {
   console.log("这里仅仅返回成功的结果::", res)
})