Skip to content

Commit

Permalink
fix: ts-vue bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-huxiyang committed Sep 29, 2024
1 parent 6367898 commit 9596850
Show file tree
Hide file tree
Showing 11 changed files with 266 additions and 120 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
"vite-plugin-vue-devtools": "^7.2.1",
"vitest": "^2.0.1",
"vitest-canvas-mock": "^0.3.3",
"vue": "^3.4.31",
"vue": "^3.5.10",
"vue-tsc": "^1.8.27"
},
"engines": {
Expand Down
303 changes: 238 additions & 65 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion publish/nutui-taro/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
| [@nutui/icons-vue](https://github.com/jdf2e/nutui-icons) | `@nutui/nutui` 使用的图标库 | ![nutui](https://img.shields.io/npm/v/@nutui/icons-vue.svg?label=%20) |
| [@nutui/icons-vue-taro](https://github.com/jdf2e/nutui-icons) | `@nutui/nutui-taro` 使用的图标库 | ![nutui](https://img.shields.io/npm/v/@nutui/icons-vue-taro.svg?label=%20) |
| [@nutui/touch-emulator](packages/nutui-touch-emulator) | 在桌面端使用 NutUI 的辅助库 | ![nutui](https://img.shields.io/npm/v/@nutui/touch-emulator.svg?label=%20) |
| [@nutui/auto-import-resolver](packages/nutui-auto-import-resolver) | `unplugin-auto-import` 插件的 reolver 配置 | ![nutui](https://img.shields.io/npm/v/@nutui/auto-import-resolver.svg?label=%20) |
| [@nutui/auto-import-resolver](packages/nutui-auto-import-resolver) | `unplugin-auto-import` 插件的 resolver 配置 | ![nutui](https://img.shields.io/npm/v/@nutui/auto-import-resolver.svg?label=%20) |
| [@nutui/playground](packages/nutui-playground) | NutUI 在线 Playground | - |
| [nutui-demo](https://github.com/jdf2e/nutui-demo) | NutUI 官方示例合集 | - |

Expand Down
2 changes: 1 addition & 1 deletion publish/nutui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
| [@nutui/icons-vue](https://github.com/jdf2e/nutui-icons) | `@nutui/nutui` 使用的图标库 | ![nutui](https://img.shields.io/npm/v/@nutui/icons-vue.svg?label=%20) |
| [@nutui/icons-vue-taro](https://github.com/jdf2e/nutui-icons) | `@nutui/nutui-taro` 使用的图标库 | ![nutui](https://img.shields.io/npm/v/@nutui/icons-vue-taro.svg?label=%20) |
| [@nutui/touch-emulator](packages/nutui-touch-emulator) | 在桌面端使用 NutUI 的辅助库 | ![nutui](https://img.shields.io/npm/v/@nutui/touch-emulator.svg?label=%20) |
| [@nutui/auto-import-resolver](packages/nutui-auto-import-resolver) | `unplugin-auto-import` 插件的 reolver 配置 | ![nutui](https://img.shields.io/npm/v/@nutui/auto-import-resolver.svg?label=%20) |
| [@nutui/auto-import-resolver](packages/nutui-auto-import-resolver) | `unplugin-auto-import` 插件的 resolver 配置 | ![nutui](https://img.shields.io/npm/v/@nutui/auto-import-resolver.svg?label=%20) |
| [@nutui/playground](packages/nutui-playground) | NutUI 在线 Playground | - |
| [nutui-demo](https://github.com/jdf2e/nutui-demo) | NutUI 官方示例合集 | - |

Expand Down
13 changes: 2 additions & 11 deletions src/packages/__VUE/comment/components/CmtImages.taro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<view class="nut-comment-images__play"></view>
</view>
<!-- images -->
<template v-for="(itI, index) in images" :key="itI.id">
<template v-for="(itI, index) in images" :key="index">
<view
v-if="(type == 'multi' && videos.length + index < 9) || type != 'multi'"
class="nut-comment-images__item nut-comment-images__item--imgbox"
Expand All @@ -37,16 +37,7 @@ import { createComponent } from '@/packages/utils/create'
const { create } = createComponent('comment-images')
import { Right } from '@nutui/icons-vue-taro'
interface VideosType {
id?: number | string
mainUrl: string
videoUrl: string
}
interface ImagesType {
smallImgUrl: string
bigImgUrl: string
imgUrl: string
}
import { VideosType, ImagesType } from '../type'
export default create({
props: {
type: {
Expand Down
13 changes: 2 additions & 11 deletions src/packages/__VUE/comment/components/CmtImages.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<view class="nut-comment-images__play"></view>
</view>
<!-- images -->
<template v-for="(itI, index) in images" :key="itI.id">
<template v-for="(itI, index) in images" :key="index">
<view
v-if="(type == 'multi' && videos.length + index < 9) || type != 'multi'"
class="nut-comment-images__item nut-comment-images__item--imgbox"
Expand All @@ -37,16 +37,7 @@ import { createComponent } from '@/packages/utils/create'
const { create } = createComponent('comment-images')
import { Right } from '@nutui/icons-vue'
interface VideosType {
id?: number | string
mainUrl: string
videoUrl: string
}
interface ImagesType {
smallImgUrl: string
bigImgUrl: string
imgUrl: string
}
import { VideosType, ImagesType } from '../type'
export default create({
props: {
type: {
Expand Down
12 changes: 1 addition & 11 deletions src/packages/__VUE/comment/index.taro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,7 @@ import CommentHeader from './components/CmtHeader.taro.vue'
import CommentImages from './components/CmtImages.taro.vue'
import CommentBottom from './components/CmtBottom.taro.vue'
import { useLocale } from '@/packages/utils/useLocale'
interface VideosType {
id?: number | string
mainUrl: string
videoUrl: string
}
interface ImagesType {
smallImgUrl: string
bigImgUrl: string
imgUrl: string
}
import { VideosType, ImagesType } from './type'
const { create } = createComponent('comment')
const cN = 'NutComment'
Expand Down
12 changes: 1 addition & 11 deletions src/packages/__VUE/comment/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,7 @@ import CommentHeader from './components/CmtHeader.vue'
import CommentImages from './components/CmtImages.vue'
import CommentBottom from './components/CmtBottom.vue'
import { useLocale } from '@/packages/utils/useLocale'
interface VideosType {
id?: number | string
mainUrl: string
videoUrl: string
}
interface ImagesType {
smallImgUrl: string
bigImgUrl: string
imgUrl: string
}
import { VideosType, ImagesType } from './type'
const { create } = createComponent('comment')
const cN = 'NutComment'
Expand Down
10 changes: 10 additions & 0 deletions src/packages/__VUE/comment/type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export interface VideosType {
id?: number | string
mainUrl: string
videoUrl: string
}
export interface ImagesType {
smallImgUrl: string
bigImgUrl: string
imgUrl: string
}
10 changes: 2 additions & 8 deletions src/packages/__VUE/sku/components/SkuSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,9 @@
<script lang="ts">
import { ref, watch, onMounted } from 'vue'
import { createComponent } from '@/packages/utils/create'
const { create } = createComponent('sku-select')
import { SkuInfo } from '../type'
interface SkuInfo {
name: string
id: number
active: boolean
disable: boolean
[props: string]: any
}
const { create } = createComponent('sku-select')
export default create({
props: {
sku: {
Expand Down
7 changes: 7 additions & 0 deletions src/packages/__VUE/sku/type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export interface SkuInfo {
name: string
id: number
active: boolean
disable: boolean
[props: string]: any

Check warning on line 6 in src/packages/__VUE/sku/type.ts

View check run for this annotation

codefactor.io / CodeFactor

src/packages/__VUE/sku/type.ts#L6

Unexpected any. Specify a different type. (@typescript-eslint/no-explicit-any)
}

0 comments on commit 9596850

Please sign in to comment.