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 🙏

© 2026 – Pkg Stats / Ryan Hefner

terminaldesktop

v1.0.56

Published

终端组件库,快速开发工具

Readme

介绍

本组件库旨在提供一套基于Vant,简单、易用的组件,用于构建终端应用。它提供有一些列快速连接API的方法。

启动示例

控制台运行:npm run serve

启动后浏览器打开:http://localhost:5008

开始使用

import {Terminaldesktop} from 'terminaldesktop'

在Vue引入插件。并可同时传入配置项。

app.use(Terminaldesktop,{ request: { baseURL:"/api" } })

并引入样式:import 'terminaldesktop/dist/package/index.css' 即可开始使用。

如果是在uniapp中使用

如果你是在uniapp中使用此框架,并且需要适配小程序和app,你需要做一下axios的适配。

首先安装axios-adapter-uniapp适配工具: npm i axios-adapter-uniapp --save

然后在request配置文件中使用axios-adapter-uniapp适配器。

import axiosAdapterUniapp from 'axios-adapter-uniapp'

export default {
    // baseURL: "http://localhost",
    // 注意下面这行代码用于应用axios-adapter-uniapp适配器
    adapter: axiosAdapterUniapp,
}

常用工具方法:

可通过'terminaldesktop'解包导入以下方法或者对象。import { version } from 'terminaldesktop'

config对象

配置项,可在插件传入配置项覆盖默认配置。包含有:

  • function get(configType, path, customConfig) 查找获取配置项。

  • config.final.request 获取请求配置。

  • version() 获取当前版本号。

  • tool对象 包含常用工具方法。

  • function createTerminalApp(component, rootProps = undefined, configs = {}) 用于创建终端应用。

  • function requestApi(options) 数据请求方法,服务器前缀可配置{ request: { baseURL:"http://api/" } }

使用本地配置

我们提供了本地配置支持,你可创建好config文件之后,在Vue引入插件时同时进行注入:

import { Terminaldesktop } from 'terminaldesktop'
import request from 'local/config/request.config.js'
import response from 'local/config/response.config.js'
import runtimeConfig from './local/runtime.config.js'

app.use( Terminaldesktop ,{ configs:{ request: request,response: response,runtime: runtimeConfig }})

常见问题

  • 如何在请求时加入token

可利用axios的transformRequest配置项,在请求时验证和加入token。在request全局配置中进行配置:

transformRequest: [function(data, headers) {
    const token = '请求token';
    headers["Authorization"] = token || '';
    return JSON.stringify(data);
}]

更多用法可查看axios配置项transformRequest的相关文档。

更新日志

  • 1.0.41 修复了TdDatalist存在的分页与重新请求数据加载方式问题。
  • 1.0.35 增加adapter文件夹的输出,uniapp用户可复制使用适配文件。修复部分bug。
  • 1.0.34 增加了对uniapp的支持:requestApi(axios)适配;提示组件的适配。增加dist/config文件输出。
  • 1.0.32 修复TdDatalist存在的问题。修复TdNavigatorBar存在的样式问题。优化requestApi请求方法。
  • 1.0.26 增加NavigatorBar支持RouterView方式,由子页面控制。
  • 1.0.0 初始版本。