Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 15 additions & 28 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,43 +11,36 @@
"source.fixAll.eslint": "explicit"
},
// 添加 vue 支持
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"vue"
],
"eslint.validate": ["javascript", "javascriptreact", "typescript", "vue"],
// #去掉代码结尾的分号
"prettier.semi": true,
// #使用单引号替代双引号
"prettier.singleQuote": true,
// #让函数(名)和后面的括号之间加个空格
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,

"typescript.validate.enable": true,
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.suggestionActions.enabled": true,
"typescript.enablePromptUseWorkspaceTsdk": true,

"i18n-ally.keystyle": "flat",
"i18n-ally.sourceLanguage": "zh-CN",
"i18n-ally.displayLanguage": "zh-CN",
"i18n-ally.sortKeys": true,
"i18n-ally.namespace": true,
"i18n-ally.keepFulfilled": true,
"i18n-ally.enabledParsers": [
"ts",
"js",
"json"
],
"i18n-ally.enabledFrameworks": [
"vue",
"vue-sfc"
],
"i18n-ally.enabledParsers": ["ts", "js", "json"],
"i18n-ally.enabledFrameworks": ["vue", "vue-sfc"],
"i18n-ally.extract.autoDetect": true,
"i18n-ally.refactor.templates": [
{
"source": "html-inline",
"template": "{{ $t('{key}'{args}) }}" // 不带参数的情况
"template": "{{ $t('{key}'{args}) }}" // 不带参数的情况
},
{
"source": "html-attribute",
"template": "$t('{key}'{args})",
"template": "$t('{key}'{args})"
},
{
"source": "js-string",
Expand All @@ -56,22 +49,17 @@
{
"source": "js-template",
"template": "t('{key}'{args})"
},
}
],
"i18n-ally.extract.parsers.html": {
"attributes": ["text", "title", "alt", "placeholder", "label", "aria-label", "cancel-text", "close-text", "left-text", "right-text", "value"],
"ignoredTags": ["script", "style"],
"vBind": true,
"inlineText": true
},
"i18n-ally.keysInUse": [
"zh-CN",
"en-US"
],
"i18n-ally.keysInUse": ["zh-CN", "en-US"],
"common-intellisense.ui": [],
"i18n-ally.localesPaths": [
"src/locale"
],
"i18n-ally.localesPaths": ["src/locale"],
"i18n-ally.extract.ignored": [
"不如摸鱼去",
"二狗",
Expand All @@ -94,6 +82,5 @@
"芦叶满汀洲,寒沙带浅流。二十年重过南楼。柳下系船犹未稳,能几日,又中秋。黄鹤断矶头,故人曾到否?旧江山浑是新愁。欲买桂花同载酒,终不似,少年游。",
"`${item}`"
],
"i18n-ally.extract.ignoredByFiles": {
}
}
"i18n-ally.extract.ignoredByFiles": {}
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"release-tag": "esno ./scripts/release.ts",
"build:web-types": "esno ./scripts/build-web-types.ts",
"compiler": "esno ./scripts/compiler.ts",
"check:component": "vue-tsc -p ./src/uni_modules/wot-design-uni/tsconfig.json --noEmit",
"upload:mp-weixin": "uni build -p mp-weixin && minici --platform weixin",
"upload:mp-alipay": "uni build -p mp-alipay && minici --platform alipay",
"upload:mp-dingtalk": "uni build -p mp-dingtalk && minici --platform dd",
Expand Down Expand Up @@ -108,7 +109,7 @@
"@types/node": "^18.15.3",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"@uni-helper/uni-types": "1.0.0-alpha.4",
"@uni-helper/uni-types": "1.0.0-alpha.7",
"@uni-helper/vite-plugin-uni-components": "^0.1.0",
"@vant/area-data": "^1.4.1",
"@vant/touch-emulator": "^1.4.0",
Expand Down
14 changes: 7 additions & 7 deletions src/uni_modules/wot-design-uni/components/wd-tour/wd-tour.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ export default {
</script>

<script lang="ts" setup>
import { ref, computed, watch, nextTick } from 'vue'
import { ref, computed, watch, nextTick, type CSSProperties } from 'vue'
import { tourProps } from './types'
// #ifdef H5
import useLockScroll from '../composables/useLockScroll'
import { useLockScroll } from '../composables/useLockScroll'
// #endif

interface ElementRect {
Expand All @@ -80,7 +80,7 @@ const { lock, unlock } = useLockScroll(() => props.modelValue)

// 响应式数据
const currentIndex = ref(0)
const elementInfo = ref({
const elementInfo = ref<ElementRect>({
top: 0,
left: 0,
width: 0,
Expand Down Expand Up @@ -141,11 +141,11 @@ const highlightStyle = computed(() => {
const popoverStyle = computed(() => {
const style: {
transition: string
position: string
position: CSSProperties['position']
left: string
transform: string
maxWidth: string
textAlign: string
textAlign: CSSProperties['text-align']
zIndex: number
top?: string
bottom?: string
Expand Down Expand Up @@ -238,7 +238,7 @@ function initializeElementInfo(res: ElementRect) {
elementInfo.value = res
// 调整元素位置信息,加上窗口顶部偏移量
elementInfo.value.top = res.top + windowTop.value
elementInfo.value.bottom = res.bottom + windowTop.value
elementInfo.value.bottom = (res.bottom !== undefined ? res.bottom : 0) + windowTop.value
}
// 获取有效的页面边界(顶部和底部安全区域)
function getEffectiveBoundaries() {
Expand All @@ -264,7 +264,7 @@ function checkScrollNeeds(res: ElementRect, boundaries: { top: number; bottom: n
}

// 处理滚动逻辑
function handleScrolling(res: ElementRect, scrollNeeds, boundaries: { top: number; bottom: number }) {
function handleScrolling(res: ElementRect, scrollNeeds: ReturnType<typeof checkScrollNeeds>, boundaries: { top: number; bottom: number }) {
if (scrollNeeds.up) {
// 元素被顶部遮挡,需要提示框往上走,页面往下走
scrollUp(res, boundaries)
Expand Down
51 changes: 51 additions & 0 deletions src/uni_modules/wot-design-uni/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
// "extends": "@vue/tsconfig/tsconfig.json",
"compilerOptions": {
"module": "ESNext",
"moduleResolution": "Node",
"resolveJsonModule": true,
"useDefineForClassFields": true,

// Required in Vue projects
"jsx": "preserve",

// `"noImplicitThis": true` is part of `strict`
// Added again here in case some users decide to disable `strict`.
// This enables stricter inference for data properties on `this`.
"noImplicitThis": true,
"strict": true,

// Required in Vite
"isolatedModules": true,
// For `<script setup>`
// See <https://devblogs.microsoft.com/typescript/announcing-typescript-4-5-beta/#preserve-value-imports>
// "preserveValueImports": true,
// Enforce using `import type` instead of `import` for types
// "importsNotUsedAsValues": "error",

// A few notes:
// - Vue 3 supports ES2016+
// - For Vite, the actual compilation target is determined by the
// `build.target` option in the Vite config.
// So don't change the `target` field here. It has to be
// at least `ES2020` for dynamic `import()`s and `import.meta` to work correctly.
// - If you are not using Vite, feel free to override the `target` field.
"target": "ESNext",

// Recommended
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
// See <https://github.com/vuejs/vue-cli/pull/5688>
"skipLibCheck": true,

"baseUrl": ".",
"sourceMap": true,
"verbatimModuleSyntax": true,
// "ignoreDeprecations": "5.0",
"types": ["node", "@dcloudio/types", "mini-types", "@uni-helper/uni-types", "miniprogram-api-typings", "@types/node"]
},
"vueCompilerOptions": {
"plugins": ["@uni-helper/uni-types/volar-plugin"]
},
"exclude": ["node_modules", "unpackage", "src/**/*.nvue"]
}
Loading