Initial project

This commit is contained in:
Timi
2025-07-08 16:33:11 +08:00
parent 772ac5fcc5
commit 26a60a6a7d
22 changed files with 10476 additions and 129 deletions

12
.editorconfig Normal file
View File

@ -0,0 +1,12 @@
# http://editorconfig.org
root = true
[*]
charset = utf-8
indent_size = 4
indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false

15
.eslintignore Normal file
View File

@ -0,0 +1,15 @@
*.sh
node_modules
*.md
*.woff
*.ttf
.vscode
.idea
dist
/public
/docs
.husky
.local
.eslintrc.js
dist
pnpm-lock.yaml

78
.eslintrc.js Normal file
View File

@ -0,0 +1,78 @@
module.exports = {
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:vue/vue3-essential",
"./.eslintrc-auto-import.json"
],
"overrides": [
{
"env": {
"node": true
},
"files": [
".eslintrc.{js}"
],
"parserOptions": {
"sourceType": "script"
}
}
],
"parserOptions": {
"ecmaVersion": "latest",
"parser": "@typescript-eslint/parser",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint",
"vue"
],
"rules": { // 注释是解释使用该设置的效果,而不是设置属性本身
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
// 其他
"camelcase": 2, // 变量驼峰式命名
"quotes": ["error", "double"], // 强制双引字符串
"eqeqeq": ["error", "always"], // 强制全等比较
"semi": ["error", "always"], // 强制语句分号结束
"max-len": [
"error",
{
"code": 180
}
],
// 逗号
"comma-style": [2, "last"], // 逗号出现在行末 [first, last]
"comma-dangle": [2, "never"], // 数组或对象不可带最后一个逗号 [never, always, always-multiline]
// 空格
"no-trailing-spaces": "error", // 禁止行末存在空格
"comma-spacing": [2, { "before": false, "after": true }], // 逗号后需要空格
"semi-spacing": ["error", { "before": false, "after": true }], // 分号后需要空格
"computed-property-spacing": [2, "never"], // 以方括号取对象属性时,[ 后面和 ] 前面需要空格, [never, always]
"space-before-function-paren": ["error", { // 函数括号前空格
"anonymous": "always", // 针对匿名函数表达式,比如 function () {}
"named": "never", // 针对命名函数表达式,比如 function foo() {}
"asyncArrow": "always" // 针对异步的箭头函数表达式,比如 async () => {}
}],
// 缩进
"no-mixed-spaces-and-tabs": "off", // 允许混合缩进
"no-tabs": ["error", { allowIndentationTabs: true }], // 使用 Tab 缩进
"indent": ["error", "tab", { // Tab 缩进相关
SwitchCase: 1 // Switch Case 缩进一级
}],
// 框架
"@typescript-eslint/ban-types": "off", // TS 允许空对象
"@typescript-eslint/no-empty-function": "off", // TS 允许空函数
"@typescript-eslint/no-explicit-any": "off", // TS 允许 any 类型
"@typescript-eslint/explicit-module-boundary-types": "off", // TS 允许显式模块边界类型?
"vue/no-multiple-template-root": "off", // Vue3 支持多个根节点
"@typescript-eslint/no-this-alias": "off", // 允许 this 变量本地化
"vue/no-v-model-argument": "off", // 允许 v-model 支持参数
"vue/multi-word-component-names": "off" // 允许单个词语的组件名
}
};

144
.gitignore vendored
View File

@ -1,138 +1,28 @@
# ---> Node
# Logs # Logs
logs logs
*.log *.log
npm-debug.log* npm-debug.log*
yarn-debug.log* yarn-debug.log*
yarn-error.log* yarn-error.log*
pnpm-debug.log*
lerna-debug.log* lerna-debug.log*
.pnpm-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html) node_modules
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional stylelint cache
.stylelintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local
# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
# Next.js build output
.next
out
# Nuxt.js build / generate output
.nuxt
dist dist
dist-ssr
*.local
# Gatsby files # Editor directories and files
.cache/ .vscode/*
# Comment in the public line in if your project uses Gatsby and not Next.js !.vscode/extensions.json
# https://nextjs.org/blog/next-9-1#public-directory-support .idea
# public .DS_Store
*.suo
# vuepress build output *.ntvs*
.vuepress/dist *.njsproj
*.sln
# vuepress v2.x temp and cache directory *.sw?
.temp
.cache
# vitepress build output
**/.vitepress/dist
# vitepress cache directory
**/.vitepress/cache
# Docusaurus cache and generated files
.docusaurus
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
/.eslintrc-auto-import.json
/components.d.ts
/examples/auto-imports.d.ts

View File

@ -1,3 +1,5 @@
# timi-tdesign-mobile # Vue 3 + TypeScript + Vite
Timi 前端移动端组件库 This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
Learn more about the recommended Project Setup and IDE Support in the [Vue Docs TypeScript Guide](https://vuejs.org/guide/typescript/overview.html#project-setup).

11
examples/Root.vue Normal file
View File

@ -0,0 +1,11 @@
<template>
<div>
<t-loading />
</div>
</template>
<script lang="ts" setup></script>
<style lang="less" scoped>
</style>

13
examples/main.ts Normal file
View File

@ -0,0 +1,13 @@
import { createApp } from "vue";
import Root from "./Root.vue";
import TimiWebUI, { axios, VPopup } from "timi-web"; // 本地开发
import "timi-web/style.css";
import "tdesign-mobile-vue/es/style/index.css";
axios.defaults.baseURL = "http://localhost:8091";
const app = createApp(Root);
app.use(TimiWebUI);
app.directive("popup", VPopup);
app.mount("#root");

5
examples/vite-env.d.ts vendored Normal file
View File

@ -0,0 +1,5 @@
declare module "*.vue" {
import type { DefineComponent } from "vue";
const component: DefineComponent<{}, {}, any>;
export default component;
}

12
index.html Normal file
View File

@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Vite + Vue + TS</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/examples/main.ts"></script>
</body>
</html>

65
package.json Normal file
View File

@ -0,0 +1,65 @@
{
"name": "timi-tdesign-mobile",
"main": "./dist/timi-tdesign-mobile.umd.js",
"types": "./dist/src/index.d.ts",
"module": "./dist/timi-tdesign-mobile.mjs",
"style": "./dist/style.css",
"private": false,
"version": "1.0.0",
"license": "MIT",
"scripts": {
"dev": "vite",
"dev:doc": "pnpm run -C docs dev",
"build": "vue-tsc --noEmit && vite build",
"build:doc": "pnpm run -C docs build"
},
"files": [
"dist/**",
"src/**",
"examples/**",
"README.md",
"package.json"
],
"exports": {
".": {
"import": "./dist/timi-tdesign-mobile.mjs",
"require": "./dist/timi-tdesign-mobile.umd.js"
},
"./style.css": "./dist/timi-tdesign-mobile.css"
},
"engines": {
"node": ">=16.0.0"
},
"dependencies": {
"vue": "^3.5.13",
"vue-router": "4.5.0"
},
"devDependencies": {
"@types/node": "^22.13.5",
"@typescript-eslint/eslint-plugin": "^8.25.0",
"@typescript-eslint/parser": "^8.25.0",
"@vitejs/plugin-basic-ssl": "^2.0.0",
"@vitejs/plugin-vue": "^5.2.4",
"@vue/cli-plugin-babel": "^5.0.8",
"@vue/compiler-sfc": "^3.5.16",
"@vue/eslint-config-prettier": "^10.2.0",
"@vue/eslint-config-typescript": "^14.4.0",
"eslint": "^9.21.0",
"eslint-config-prettier": "^10.0.1",
"eslint-plugin-prettier": "^5.2.3",
"eslint-plugin-promise": "^7.2.1",
"eslint-plugin-vue": "^9.32.0",
"less": "^4.3.0",
"prettier": "^3.5.2",
"typescript": "^5.8.3",
"unplugin-auto-import": "^19.3.0",
"unplugin-vue-components": "^28.7.0",
"vite-plugin-dts": "^4.5.4",
"vite-plugin-vue-setup-extend": "^0.4.0",
"@vue/tsconfig": "^0.7.0",
"vite": "6.3.4",
"vue-tsc": "^2.2.10",
"tdesign-mobile-vue": "^1.9.0",
"timi-web": "link:..\\timi-web"
}
}

9681
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,70 @@
/* TDesign 腾讯云样式附加修改 */
@cellPadding: 12px;
.cellStyle() {
margin: 0 16px;
border: none !important;
border-radius: 6px;
}
.cellSplit() {
transform: none;
border-color: #C6C6C8 !important;
-webkit-transform: none;
}
.t-image-viewer {
.t-swiper-item {
overflow: hidden;
}
}
.t-cell-group {
.cellStyle();
overflow: hidden;
}
.t-form {
.cellStyle();
.t-form__item {
padding: @cellPadding;
&:not(:last-child)::after {
.cellSplit();
}
}
}
.t-cell,
.t-swipe-cell {
padding: @cellPadding;
&:after {
.cellSplit();
}
}
.t-button {
.cellStyle();
height: auto;
padding: @cellPadding;
line-height: 1.4;
font-weight: normal;
}
.t-divider {
&::before,
&::after {
.cellSplit();
}
&.t-divider--horizontal {
margin: 0;
}
}
.t-popup {
transition: all 520ms var(--tui-bezier);
}

View File

@ -0,0 +1,258 @@
/* TDesign 腾讯云样式 */
:root, :root[theme-mode="light"] {
--td-brand-color-1: #d5e7ff;
--td-brand-color-2: #aacfff;
--td-brand-color-3: #7fb7ff;
--td-brand-color-4: #559eff;
--td-brand-color-5: #2a86ff;
--td-brand-color-6: #006eff;
--td-brand-color-7: #0058df;
--td-brand-color-8: #0042bf;
--td-brand-color-9: #002da0;
--td-brand-color-10: #001780;
--td-warning-color-1: #ffe8d5;
--td-warning-color-2: #ffd0aa;
--td-warning-color-3: #ffb97f;
--td-warning-color-4: #ffa155;
--td-warning-color-5: #ff8a2a;
--td-warning-color-6: #ff7200;
--td-warning-color-7: #df5900;
--td-warning-color-8: #bf4000;
--td-warning-color-9: #a02800;
--td-warning-color-10: #800f00;
--td-error-color-1: #fbe0e0;
--td-error-color-2: #f6c1c1;
--td-error-color-3: #f2a2a2;
--td-error-color-4: #ee8383;
--td-error-color-5: #e96464;
--td-error-color-6: #e54545;
--td-error-color-7: #cc3842;
--td-error-color-8: #b42b3f;
--td-error-color-9: #9c1f3b;
--td-error-color-10: #831238;
--td-success-color-1: #d6f4e4;
--td-success-color-2: #adeac8;
--td-success-color-3: #84dfad;
--td-success-color-4: #5cd492;
--td-success-color-5: #33ca76;
--td-success-color-6: #0abf5b;
--td-success-color-7: #09a755;
--td-success-color-8: #078f50;
--td-success-color-9: #06774a;
--td-success-color-10: #055f44;
--td-gray-color-1: #f3f4f7;
--td-gray-color-2: #e7eaef;
--td-gray-color-3: #cfd5de;
--td-gray-color-4: #b7c1ce;
--td-gray-color-5: #9eacbe;
--td-gray-color-6: #8697ad;
--td-gray-color-7: #6e829d;
--td-gray-color-8: #60708a;
--td-gray-color-9: #525e76;
--td-gray-color-10: #444c63;
--td-gray-color-11: #363a50;
--td-gray-color-12: #292c3d;
--td-gray-color-13: #1e222d;
--td-gray-color-14: #151822;
--td-font-white-1: #ffffff;
--td-font-white-2: rgba(255, 255, 255, 0.55);
--td-font-white-3: rgba(255, 255, 255, 0.35);
--td-font-white-4: rgba(255, 255, 255, 0.22);
--td-font-gray-1: rgba(0, 0, 0, 0.9);
--td-font-gray-2: rgba(0, 0, 0, 0.6);
--td-font-gray-3: rgba(0, 0, 0, 0.4);
--td-font-gray-4: rgba(0, 0, 0, 0.25);
--td-brand-color: var(--td-brand-color-6);
--td-warning-color: var(--td-warning-color-6);
--td-error-color: var(--td-error-color-6);
--td-success-color: var(--td-success-color-6);
--td-brand-color-hover: var(--td-brand-color-5);
--td-brand-color-focus: var(--td-brand-color-2);
--td-brand-color-active: var(--td-brand-color-7);
--td-brand-color-disabled: var(--td-brand-color-2);
--td-brand-color-light: var(--td-brand-color-1);
--td-warning-color-hover: var(--td-warning-color-5);
--td-warning-color-focus: var(--td-warning-color-2);
--td-warning-color-active: var(--td-warning-color-7);
--td-warning-color-disabled: var(--td-warning-color-2);
--td-warning-color-light: var(--td-warning-color-1);
--td-error-color-hover: var(--td-error-color-5);
--td-error-color-focus: var(--td-error-color-2);
--td-error-color-active: var(--td-error-color-7);
--td-error-color-disabled: var(--td-error-color-2);
--td-error-color-light: var(--td-error-color-1);
--td-success-color-hover: var(--td-success-color-5);
--td-success-color-focus: var(--td-success-color-2);
--td-success-color-active: var(--td-success-color-7);
--td-success-color-disabled: var(--td-success-color-2);
--td-success-color-light: var(--td-success-color-1);
--td-mask-active: rgba(0, 0, 0, 0.8);
--td-mask-disabled: rgba(255, 255, 255, 0.6);
--td-bg-color-page: #ebeef2;
--td-bg-color-container: #fff;
--td-bg-color-container-hover: var(--td-gray-color-2);
--td-bg-color-container-active: var(--td-gray-color-3);
--td-bg-color-container-select: #fff;
--td-bg-color-secondarycontainer: var(--td-gray-color-1);
--td-bg-color-secondarycontainer-hover: var(--td-gray-color-2);
--td-bg-color-secondarycontainer-active: var(--td-gray-color-3);
--td-bg-color-component: var(--td-gray-color-2);
--td-bg-color-component-hover: var(--td-gray-color-3);
--td-bg-color-component-active: var(--td-gray-color-4);
--td-bg-color-component-disabled: var(--td-gray-color-2);
--td-bg-color-secondarycomponent: var(--td-gray-color-3);
--td-bg-color-secondarycomponent-hover: var(--td-gray-color-4);
--td-bg-color-secondarycomponent-active: var(--td-gray-color-5);
--td-bg-color-specialcomponent: #fff;
--td-text-color-primary: var(--td-font-gray-1);
--td-text-color-secondary: var(--td-font-gray-2);
--td-text-color-placeholder: var(--td-font-gray-3);
--td-text-color-disabled: var(--td-font-gray-4);
--td-text-color-anti: #fff;
--td-text-color-brand: var(--td-brand-color-6);
--td-text-color-link: var(--td-brand-color-6);
--td-border-level-1-color: var(--td-gray-color-2);
--td-component-stroke: var(--td-gray-color-2);
--td-border-level-2-color: var(--td-gray-color-3);
--td-component-border: var(--td-gray-color-3);
--td-shadow-1: 0 2px 3px rgba(0, 0, 0, 0.2);
--td-shadow-2: 0 2px 4px 0 rgba(54, 58, 80, 0.32);
--td-shadow-3: 0 0 20px 0 rgba(19, 41, 75, 0.2);
--td-shadow-inset-top: inset 0 0.5px 0 #e7eaef;
--td-shadow-inset-right: inset 0.5px 0 0 #e7eaef;
--td-shadow-inset-bottom: inset 0 -0.5px 0 #e7eaef;
--td-shadow-inset-left: inset -0.5px 0 0 #e7eaef;
--td-table-shadow-color: rgba(0, 0, 0, 0.08);
--td-scrollbar-color: rgba(0, 0, 0, 0.1);
--td-scrollbar-hover-color: rgba(0, 0, 0, 0.3);
--td-scroll-track-color: #fff;
--td-radius-small: 0px;
--td-radius-default: 0px;
--td-radius-medium: 0px;
--td-radius-large: 0px;
--td-radius-extraLarge: 12px;
--td-radius-round: 999px;
--td-radius-circle: 50%;
--td-font-family: SimSun, PingFang SC, Microsoft YaHei, Arial Regular;
--td-font-family-medium: SimSun, PingFang SC, Microsoft YaHei, Arial Medium;
--td-font-size-link-small: 12px;
--td-font-size-link-medium: 12px;
--td-font-size-link-large: 14px;
--td-font-size-mark-small: 12px;
--td-font-size-mark-medium: 12px;
--td-font-size-body-small: 12px;
--td-font-size-body-medium: 12px;
--td-font-size-body-large: 14px;
--td-font-size-title-small: 12px;
--td-font-size-title-medium: 14px;
--td-font-size-title-large: 16px;
--td-font-size-headline-small: 24px;
--td-font-size-headline-medium: 28px;
--td-font-size-headline-large: 36px;
--td-font-size-display-medium: 48px;
--td-font-size-display-large: 64px;
--td-line-height-link-small: 20px;
--td-line-height-link-medium: 20px;
--td-line-height-link-large: 22px;
--td-line-height-mark-small: 20px;
--td-line-height-mark-medium: 22px;
--td-line-height-body-small: 20px;
--td-line-height-body-medium: 20px;
--td-line-height-body-large: 22px;
--td-line-height-title-small: 20px;
--td-line-height-title-medium: 22px;
--td-line-height-title-large: 24px;
--td-line-height-headline-small: 32px;
--td-line-height-headline-medium: 36px;
--td-line-height-headline-large: 44px;
--td-line-height-display-medium: 56px;
--td-line-height-display-large: 72px;
--td-font-link-small: 400 var(--td-font-size-link-small) / var(--td-line-height-link-small) var(--td-font-family);
--td-font-link-medium: 400 var(--td-font-size-link-medium) / var(--td-line-height-link-medium) var(--td-font-family);
--td-font-link-large: 400 var(--td-font-size-link-large) / var(--td-line-height-link-large) var(--td-font-family);
--td-font-mark-small: 600 var(--td-font-size-mark-small) / var(--td-line-height-mark-small) var(--td-font-family);
--td-font-mark-medium: 600 var(--td-font-size-mark-medium) / var(--td-line-height-mark-medium) var(--td-font-family);
--td-font-body-small: 400 var(--td-font-size-body-small) / var(--td-line-height-body-small) var(--td-font-family);
--td-font-body-medium: 400 var(--td-font-size-body-small) / var(--td-line-height-body-small) var(--td-font-family);
--td-font-body-large: 400 var(--td-font-size-body-large) / var(--td-line-height-body-large) var(--td-font-family);
--td-font-title-small: 600 var(--td-font-size-title-small) / var(--td-line-height-title-small) var(--td-font-family);
--td-font-title-medium: 600 var(--td-font-size-title-medium) / var(--td-line-height-title-medium) var(--td-font-family);
--td-font-title-large: 600 var(--td-font-size-title-large) / var(--td-line-height-title-large) var(--td-font-family);
--td-font-headline-small: 600 var(--td-font-size-headline-small) / var(--td-line-height-headline-small) var(--td-font-family);
--td-font-headline-medium: 600 var(--td-font-size-headline-medium) / var(--td-line-height-headline-medium) var(--td-font-family);
--td-font-headline-large: 600 var(--td-font-size-headline-large) / var(--td-line-height-headline-large) var(--td-font-family);
--td-font-display-medium: 600 var(--td-font-size-display-medium) / var(--td-line-height-display-medium) var(--td-font-family);
--td-font-display-large: 600 var(--td-font-size-display-large) / var(--td-line-height-display-large) var(--td-font-family);
--td-size-1: 2px;
--td-size-2: 3px;
--td-size-3: 5px;
--td-size-4: 10px;
--td-size-5: 12px;
--td-size-6: 16px;
--td-size-7: 20px;
--td-size-8: 25px;
--td-size-9: 28px;
--td-size-10: 30px;
--td-size-11: 35px;
--td-size-12: 40px;
--td-size-13: 48px;
--td-size-14: 56px;
--td-size-15: 64px;
--td-size-16: 72px;
--td-comp-size-xxxs: var(--td-size-6);
--td-comp-size-xxs: var(--td-size-7);
--td-comp-size-xs: var(--td-size-8);
--td-comp-size-s: var(--td-size-9);
--td-comp-size-m: var(--td-size-10);
--td-comp-size-l: var(--td-size-11);
--td-comp-size-xl: var(--td-size-12);
--td-comp-size-xxl: var(--td-size-13);
--td-comp-size-xxxl: var(--td-size-14);
--td-comp-size-xxxxl: var(--td-size-15);
--td-comp-size-xxxxxl: var(--td-size-16);
--td-pop-padding-s: 0;
--td-pop-padding-m: 0;
--td-pop-padding-l: 0;
--td-pop-padding-xl: var(--td-size-5);
--td-pop-padding-xxl: var(--td-size-6);
--td-comp-paddingLR-xxs: var(--td-size-1);
--td-comp-paddingLR-xs: var(--td-size-3);
--td-comp-paddingLR-s: var(--td-size-4);
--td-comp-paddingLR-m: var(--td-size-5);
--td-comp-paddingLR-l: var(--td-size-7);
--td-comp-paddingLR-xl: var(--td-size-8);
--td-comp-paddingLR-xxl: var(--td-size-8);
--td-comp-paddingTB-xxs: var(--td-size-1);
--td-comp-paddingTB-xs: var(--td-size-3);
--td-comp-paddingTB-s: var(--td-size-4);
--td-comp-paddingTB-m: var(--td-size-5);
--td-comp-paddingTB-l: var(--td-size-7);
--td-comp-paddingTB-xl: var(--td-size-8);
--td-comp-paddingTB-xxl: var(--td-size-8);
--td-comp-margin-xxs: var(--td-size-1);
--td-comp-margin-xs: var(--td-size-2);
--td-comp-margin-s: var(--td-size-4);
--td-comp-margin-m: var(--td-size-5);
--td-comp-margin-l: var(--td-size-6);
--td-comp-margin-xl: var(--td-size-7);
--td-comp-margin-xxl: var(--td-size-8);
--td-comp-margin-xxxl: var(--td-size-10);
--td-comp-margin-xxxxl: var(--td-size-12);
}
.t-button .t-icon {
font-size: var(--td-comp-size-xxxs);
}
.t-button .t-icon + .t-button__text:not(:empty) {
margin-left: var(--td-comp-margin-xs);
}
.t-button .t-button__suffix:not(:empty) {
display: inline-flex;
margin-left: var(--td-comp-margin-xs);
}
.t-button--shape-circle .t-icon {
font-size: var(--td-comp-size-xxxs);
}

10
src/components/index.ts Normal file
View File

@ -0,0 +1,10 @@
/** 导出所有组件 */
import RootLayout from "./root-layout";
export default [
RootLayout
];
export {
RootLayout
};

View File

@ -0,0 +1,5 @@
import view from "./index.vue";
import { Toolkit } from "timi-web";
export const RootLayout = Toolkit.withInstall(view);
export default RootLayout;

View File

@ -0,0 +1,31 @@
<template>
<div class="tui-root-layout">
<slot></slot>
<copyright :icp="icp" :domain="domain" :author="author" />
</div>
</template>
<script lang="ts" setup>
import { Copyright } from "timi-web";
defineOptions({
name: "RootLayout"
});
withDefaults(defineProps<{
icp?: string;
domain?: string;
author?: string;
}>(), {
});
</script>
<style lang="less" scoped>
.tui-root-layout {
width: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
}
</style>

7
src/index.ts Normal file
View File

@ -0,0 +1,7 @@
import "./assets/style/tencent-cloud.less";
import "./assets/style/tencent-cloud-custom.less";
export * from "./components";
export {
};

17
tsconfig.app.json Normal file
View File

@ -0,0 +1,17 @@
{
"extends": "@vue/tsconfig/tsconfig.dom.json",
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true
},
"include": [
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.vue"
]
}

44
tsconfig.json Normal file
View File

@ -0,0 +1,44 @@
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "Node",
"useDefineForClassFields": true,
"jsx": "preserve",
"strict": true,
"sourceMap": true,
"skipLibCheck": true,
"isolatedModules": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"lib": [
"ESNext",
"DOM",
"DOM.Iterable"
],
"paths": {
"~/*": [
"./src/*"
],
"@/*": [
"./examples/*"
],
"timi-tdesign-pc": [
"./src/index.ts"
]
}
},
"include": [
"src/**/*.ts",
"src/**/*.d.ts",
"src/**/*.vue",
"examples/**/*.ts",
"examples/**/*.d.ts",
"examples/**/*.vue"
],
"references": [
{
"path": "./tsconfig.node.json"
}
]
}

11
tsconfig.node.json Normal file
View File

@ -0,0 +1,11 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"composite": true,
"module": "ESNext",
"moduleResolution": "Node"
},
"include": [
"vite.config.ts"
]
}

10
tsconfig.types.json Normal file
View File

@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"declaration": true,
"emitDeclarationOnly": true
},
"include": [
"src"
]
}

100
vite.config.ts Normal file
View File

@ -0,0 +1,100 @@
import { resolve } from "path";
import { Alias, defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import VueSetupExtend from "vite-plugin-vue-setup-extend";
import AutoImport from "unplugin-auto-import/vite";
import Components from "unplugin-vue-components/vite";
import { TDesignResolver } from "unplugin-vue-components/resolvers";
import dts from "vite-plugin-dts";
const alias: Alias[] = [
{
find: "@",
replacement: resolve(__dirname, "./examples")
},
{
find: "~",
replacement: resolve(__dirname, "./src")
},
{
find: "*",
replacement: resolve("")
},
{
find: /^timi-tdesign-mobile(\/(es|lib))?$/,
replacement: resolve(__dirname, "./src/index.ts")
}
];
export default defineConfig({
server: {
port: 3004,
host: true
},
resolve: {
alias
},
build: {
outDir: "dist",
lib: {
entry: resolve(__dirname, "./src/index.ts"),
name: "TimiTDesignMobile",
fileName: "timi-tdesign-mobile"
},
rollupOptions: {
external: [
"vue",
"vue-router",
"timi-web",
"tdesign-mobile-vue"
],
output: {
globals: {
vue: "Vue"
}
}
},
minify: "terser",
terserOptions: {
compress: {
// eslint-disable-next-line camelcase
drop_console: false,
// eslint-disable-next-line camelcase
drop_debugger: false
}
}
},
plugins: [
vue({
include: [/\.vue$/, /\.md$/]
}),
VueSetupExtend(),
dts(),
AutoImport({
imports: [
"vue",
"vue-router"
],
dts: "examples/auto-imports.d.ts",
eslintrc: {
enabled: true,
globalsPropValue: true
},
resolvers: [
TDesignResolver({
library: "mobile-vue"
})
]
}),
Components({
dirs: [
"src/components"
],
resolvers: [
TDesignResolver({
library: "mobile-vue"
})
]
})
]
});