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 🙏

© 2025 – Pkg Stats / Ryan Hefner

vue-fusion-search

v1.1.11

Published

fusion-search

Readme

## vue-fusion-search

寻源融合搜索组件,支持主题配置,组件控制等。

在项目中引入element ui的cdn链接。Echarts的cdn链接。

同时目前是在axios的实例上做了扩展。

const axios = newAxios.create({ timeout: 5000 })

使用方法如下:

  1. 引入 vue-fusion-search
    npm i vue-fusion-search
  2. package.json中引入相关依赖
    "axios": "^0.21.1"
  3. 引入cdn链接
    <!-- 引入样式 -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <!-- 引入组件库 -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
       
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts.min.js"></script>
  4. 在main.js中使用如下
    import axios from "axios";
    import FusionSearch from "vue-fusion-search";
    import "vue-fusion-search/lib/theme/index.css";
    Vue.prototype.$axios = axios;
    Vue.use(FusionSearch);
  5. 在相关使用的组件中使用如下
    <FusionSearch
          :config="config"
          :search-value="keyword"
          :emit-search="searchStatus"
          @receive-search="receiveSearch"
    />
       
    data() {
        return {
         keyword: null, // 搜索框的关键词,第三方项目需要把搜索词传到此 keyword
         searchStatus: false, // 搜索框搜索的状态,默认为 false
         config: { // 基础配置项    
         THEME: 'JFH', // 配置化主题 支持 JFH/XUNYUAN
         advUrl: 'https://rest-test.jfh.com/prt-portal', // 广告位请求地址
         advCode: ['00001014001'], // 广告位内容
         baseUrl: 'https://caigou-api-test.jfh.com/v1/api/', // 接口请求域名 (正式环境)https://caigou-api.jfh.com/v1/api/
         LOGIN: true, // 暂未开放
         showInput: true, // 是否显示搜索框
         showMix: true, // 是否显示命中详情
         showList: true, // 是否显示命中列表
         showDescription: true // 是否显示右侧
          }
        };
      },
  6. 如果选择使用自定义搜索框,不使用组件自带搜索框则需要做以下操作
    methods: {
     // 需要配置搜索方法,主要是把搜索状态重置。
     toSearch() {
       // 把目前的搜索框的值绑定到keyword上
       this.keyword = this.keywordProjectUse
       // 触发搜索
       this.searchStatus = true
     },
     receiveSearch(value) {
       // 修改搜索状态
       this.searchStatus = value.status
       // 由搜索的词同步跟新到搜索框。
       this.keywordProjectUse = value.keyword
       this.keyword = value.keyword
     }
    }
  7. 完整示例如下
   
   <template>
<div class="home">
 <!--    使用自有搜索框-->
 <input
   v-model="keywordProjectUse"
   type="text"
 >
 <button
   style="cursor: pointer;"
   @click="toSearch"
 >
   触发
 </button>
 <!--    使用自有搜索框-->
   
    <!--    使用组件-->
   
    <FusionSearch
   :config="config"
   :search-value="keyword"
   :emit-search="searchStatus"
   @receive-search="receiveSearch"
 />
   
   </div>
</template>

<script>
import FusionSearch from '../../packages/fusion-search/src/index'
export default {
  name: 'Home',
  components: {
    FusionSearch
  },
  data() {
    return {
      keywordProjectUse: null,
      keyword: null, // 搜索框的关键词,第三方项目需要把搜索词传到此 keyword
      searchStatus: false, // 搜索框搜索的状态,默认为 false
      config: { // 基础配置项
        THEME: 'JFH', // 配置化主题 支持 JFH/XUNYUAN
         baseUrl: 'https://caigou-api-test.jfh.com/v1/api/', // 接口请求域名 (正式环境)https://caigou-api.jfh.com/v1/api/
         advUrl: 'https://rest-test.jfh.com/prt-portal', // 广告位请求地址
         advCode: ['00001014001'], // 广告位内容
        LOGIN: true, // 暂未开放
        showInput: true, // 是否显示搜索框
        showMix: true, // 是否显示命中详情
        showList: true, // 是否显示命中列表
        showDescription: true // 是否显示右侧
      }
    }
  },
  methods: {
    // 需要配置搜索方法,主要是把搜索状态重置。
    toSearch() {
      // 把目前的搜索框的值绑定到keyword上
      this.keyword = this.keywordProjectUse
      // 触发搜索
      this.searchStatus = true
    },
    receiveSearch(value) {
      // 修改搜索状态
      this.searchStatus = value.status
      // 由搜索的词同步跟新到搜索框。
      this.keywordProjectUse = value.keyword
      this.keyword = value.keyword
    }
  }
}
</script>
  1. .
  2. .
  3. .
  4. .K