Browse Source

chore: repo optimize

pull/7/head
Uyarn 3 years ago
parent
commit
362ead65e0
  1. 4
      index.html
  2. 2
      package.json
  3. 41
      src/components/card/index.vue
  4. 4
      src/pages/login/index.vue
  5. 4
      src/utils/request.ts
  6. 6
      tsconfig.json

4
index.html

@ -12,9 +12,9 @@
<div id="app"></div>
<script type="module" src="/src/main.jsx"></script>
<script language="javascript">
if (window.location.host === 'tencent.tdesign.com') {
if (window.location.host === 'tdesign.tencent.com') {
const aegis = new Aegis({
id: 'rDISNMyXckGLaZFQTK', // 项目ID,即上报key
id: 'rDISNMyXgqWDFPyHMB', // 项目ID,即上报key
reportAssetSpeed: true, // 静态资源测速
});
}

2
package.json

@ -21,7 +21,7 @@
"nprogress": "^0.2.0",
"qrcode.vue": "^1.7.0",
"tdesign-icons-vue": "0.0.4",
"tdesign-vue": "^0.28.2",
"tdesign-vue": "^0.30.0",
"typescript": "^4.2.4",
"vite-plugin-vue2-svg": "^0.1.8",
"vue": "^2.6.11",

41
src/components/card/index.vue

@ -1,21 +1,21 @@
<template>
<div :class="containerCls">
<div :class="titleCls">
<span :class="titleTextCls">
<div :class="titleTextCls">
{{ title }}
<span v-if="describe" class="card-describe">{{ describe }}</span>
</span>
<span class="card-option">
</div>
<div class="card-option">
<slot name="option"></slot>
</span>
</div>
</div>
<div class="card-content">
<slot></slot>
</div>
<div v-if="size !== 'small'" class="card-spacer-bottom"></div>
<div v-if="size !== 'small'" class="card-spacer__bottom"></div>
</div>
</template>
<script>
<script lang="ts">
export default {
name: 'card',
props: {
@ -36,22 +36,22 @@ export default {
},
computed: {
containerCls() {
return ['card-container', { 'card-container-compact': this.compact, 'card-container-border': this.border }];
return ['card-container', { 'card-container--compact': this.compact, 'card-container--border': this.border }];
},
titleCls() {
return [
'card-title',
{
'card-title-small': this.size === 'small',
'card-title-default': this.size !== 'small',
'card-title--small': this.size === 'small',
'card-title--default': this.size !== 'small',
},
];
},
titleTextCls() {
return [
{
'card-title-text-small': this.size === 'small',
'card-title-text-default': this.size !== 'small',
'card-title__text--small': this.size === 'small',
'card-title__text--default': this.size !== 'small',
},
];
},
@ -68,9 +68,10 @@ export default {
.card {
&-option {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
justify-content: flex-end;
}
&-container {
@ -86,13 +87,13 @@ export default {
background: @brand-color;
}
&-compact {
&--compact {
padding: 16px 16px 0;
margin-top: 24px;
margin-bottom: 16px;
}
&-border {
&--border {
border: 1px solid #ebebeb;
}
}
@ -104,22 +105,22 @@ export default {
font-weight: 500;
color: @text-color-primary;
&-small {
&--small {
font-size: 14px;
line-height: 22px;
margin-bottom: 8px;
}
&-default {
&--default {
font-size: 20px;
line-height: 28px;
margin-bottom: 24px;
}
&-text {
&__text {
display: inline-flex;
&-default {
&--default {
margin: @spacer 0;
}
}
@ -127,7 +128,7 @@ export default {
&-describe {
font-size: 14px;
color: @bg-color-container;
color: @text-color-secondary;
line-height: 22px;
}
@ -138,7 +139,7 @@ export default {
flex: 1;
}
&-spacer-bottom {
&-spacer__bottom {
height: @spacer;
}
}

4
src/pages/login/index.vue

@ -80,7 +80,7 @@
<span class="tip1">请使用微信扫一扫登录</span>
<span class="tip2">刷新 <t-icon name="refresh" color="#0052D9" /> </span>
</div>
<qrcode-vue value="https://tencent.tdesign.com/vue/components/quick-start" :size="192" level="H" />
<qrcode-vue value="https://tdesign.tencent.com/vue/components/quick-start" :size="192" level="H" />
</div>
<div class="bottom-container">
<span class="tip" @click="toLoginStep('login-step1')">使用账号密码登录</span>
@ -229,7 +229,7 @@ export default {
EngName: '',
DeptNameString: '测试部门',
},
src2: 'https://tencent.tdesign.com/vue/components/quick-start',
src2: 'https://tdesign.tencent.com/vue/components/quick-start',
showPsw: false,
psw: '',
check1: false,

4
src/utils/request.js → src/utils/request.ts

@ -19,8 +19,6 @@ const instance = axios.create({
instance.interceptors.request.use((config) => config);
instance.defaults.retry = 3;
instance.interceptors.response.use(
(response) => {
if (response.status === 200) {
@ -46,7 +44,7 @@ instance.interceptors.response.use(
const backoff = new Promise((resolve) => {
setTimeout(() => {
resolve();
resolve({});
}, config.retryDelay || 1);
});

6
tsconfig.json

@ -3,13 +3,13 @@
"target": "es2015",
"module": "esnext",
"lib": ["esnext", "dom"],
"allowJs": true, //
"allowJs": true,
"checkJs": false,
"noImplicitAny": false, //
"noImplicitAny": false,
"isolatedModules": false,
"experimentalDecorators": true,
"esModuleInterop": true,
"noImplicitThis": false, //
"noImplicitThis": false,
"strictNullChecks": false,
"skipLibCheck": true,
"moduleResolution": "node",

Loading…
Cancel
Save