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

tj-design-vue

v1.1.70

Published

a component library for Vue 3 base on tj-design-vue

Downloads

17

Readme

安装

使用 npm 安装

推荐使用 npm 方式进行开发

npm i tj-design-vue

通过 浏览器引入 安装

目前可以通过 unpkg.com/tj-design-vue 获取到最新版本的资源,在页面上引入 js 和 css 文件即可开始使用。

<!-- vue 3 -->
<script src="https://unpkg.com/vue@next"></script>
<link rel="stylesheet" href="https://unpkg.com/tj-design-vue/lib/index.css" />
<script src="https://unpkg.com/tj-design-vue"></script>
...
<script>
	Vue.createApp({}).use(TjDesign).mount('#app');
</script>

使用

TjDesign 提供了三种方式使用组件,具体使用方式如下

基础使用

基础使用会全量注册所有组件,如果您的项目大规模使用组件,请放心使用这种方式。

import { createApp } from 'vue';
import TjDesign from 'tj-design-vue';
import App from './app.vue';

// 引入组件库的少量全局样式变量
import 'tj-design-vue/lib/index.css';

const app = createApp(App);
app.use(TjDesign);

按需引入使用

如果您对产物大小有严格的要求,可以通过 按需引入具体组件 的方式来使用。

借助 Webpack 或 Rollup 等支持 tree-shaking 特性的构建工具,可以达到按需引入的使用效果。

import { createApp } from 'vue';
import {  TjButton } from 'tj-design-vue';
import App from './app.vue';

// 引入组件库的少量全局样式变量
import 'tj-design-vue/es/button/index.css';

const app = createApp(App);
app.use(TjButton);

编辑器提示

安装注册 TjDesign 之后,在开发项目时,可以配合插件在VSCode等主流编辑器中达到提示组件名及API的效果。

如果你在使用 Volar,那么可以在 tsconfig.json 中配置 compilerOptions.types 来指定全局组件类型。

// tsconfig.json
{
  "compilerOptions": {
    // ...
    "types": ["tj-design-vue/types/volar"]
  }
}

浏览器兼容性

| IE / Edge | Firefox | Chrome | Safari | | --- | --- | --- | --- | | Edge >=84 | Firefox >=83 | Chrome >=84 | Safari >=14.1 |

FAQ

Q: 是否内置reset样式统一页面元素的默认样式 ?

A: 0.17.0 版本开始我们不再引入 reset.less,影响最大的是移除了原先全局盒子模型的设定:

*,
*::before,
*::after {
  box-sizing: border-box;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}