TDesign Vue 2.x UI Library

1.14.5 · active · verified Tue Apr 21

tdesign-vue is the official Vue 2.x component library from Tencent's TDesign specification. It provides a comprehensive set of high-quality UI components designed for desktop applications, featuring consistent APIs and UI across various TDesign framework libraries. The library supports dark mode, customizable themes, and tree-shaking for optimized bundle sizes. Currently at version 1.14.5, it observes a frequent release cadence with regular bug fixes and feature additions. Key differentiators include its backing by Tencent, enterprise-grade component suite, and robust TypeScript support, making it suitable for large-scale business applications targeting Vue 2 environments. It is distinct from `tdesign-vue-next`, which targets Vue 3.x.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to globally import and register TDesign Vue components and styles, then use a `TButton` and `TDatePicker` in a basic Vue 2 application.

import Vue from 'vue';
import TDesign from 'tdesign-vue';
import 'tdesign-vue/es/style/index.css';

// Import specific component styles if needed, or rely on global styles
// import 'tdesign-vue/es/button/style/index.css';

Vue.use(TDesign);

new Vue({
  el: '#app',
  template: `
    <div id="app">
      <t-space direction="vertical">
        <h1>TDesign Vue Quickstart</h1>
        <t-button theme="primary" @click="handleClick">Hello TDesign!</t-button>
        <t-date-picker />
      </t-space>
    </div>
  `,
  methods: {
    handleClick() {
      this.$alert('Button Clicked!', 'Info');
    }
  }
});

view raw JSON →