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

ffc-vue-test

v0.1.11

Published

The official SDK for vuejs

Downloads

1

Readme

ffc-vue-sdk

The official SDK for vuejs

安装

使用npm安装指令

npm install ffc-vue-sdk --save

在目标项目中引入源代码

在根目录下打开example文件夹,参考main.js和Home.vue的调用方法即可

Demo

Demo程序在文件夹example中可见。

运行demo需要回到跟目录下,执行

npm install
npm run serve

集成SDK到自己的项目中

初始化敏捷开关

// 初始化sdk,传入环境Secret Key和用户信息
FFCPlugin.initialize({ environmentSecret: 'YThmLWRmZjUtNCUyMDIxMDkxNzA3NTYyMV9fMl9fMjJfXzExNl9fZGVmYXVsdF82NTM3Mg==' })

在用户登录后传递用户信息给敏捷开关SDK

// 初始化用户信息,通常这一步会在登录后被调用
FFCPlugin.initUserInfo({
  userName: 'sdk-sample-js-1252',
  email: 'ts',
  key: 'sdk-sample-js-1252',
  customizeProperties: [
    {
      name: "外放地址",
      value: "?from=zhihu&group=pm"
    }
  ]
})

从敏捷开关服务器获取分配给用户的变量值,并根据业务逻辑执行不同的功能模块

async variation()
{
  const result = await this.$FfcPlugin.variationAsync(
    "主页---话术版本",
    "产品经理版1"
  );
  this.version = result.variationValue;
}

捕捉点击按钮的事件(custom event)

async trackCustomEvent(){
  const data = [
    {
      eventName: "开始使用点击事件",
    },
  ];
  const result = await this.$FfcPlugin.trackCustomEventAsync(data);
  if (result) {
    alert("事件发送成功");
  } else {
    alert("事件发送失败");
  }
}