Skip to content

Commit 13660bc

Browse files
authored
fix(mobile): fix mobile components build error (#2696)
1 parent 10ca9ef commit 13660bc

File tree

14 files changed

+500
-535
lines changed

14 files changed

+500
-535
lines changed

packages/mobile/components/container/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
*
1111
*/
1212
import Container from './src/mobile.vue'
13-
import '@opentiny/vue-theme/container/index.less'
1413

1514
/* istanbul ignore next */
1615
Container.install = function (Vue) {

packages/mobile/components/date-picker/src/mobile.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
readOnly="true"
2020
:_mode="_mode"
2121
>
22-
<icon-close slot="suffix" v-if="!state.clearable" @click="clearDisplayValue"></icon-close>
22+
<template #suffix>
23+
<icon-close v-if="!state.clearable" @click="clearDisplayValue"></icon-close>
24+
</template>
2325
</tiny-input>
2426
<tiny-mini-picker
2527
v-model:visible="state.visible"
@@ -38,7 +40,6 @@ import { renderless, api } from './renderless/vue'
3840
import MiniPicker from '../../mini-picker'
3941
import Input from '../../input'
4042
import { iconCloseCircle } from '@opentiny/vue-icon'
41-
import '@opentiny/vue-theme/date-picker/index.less'
4243

4344
export default defineComponent({
4445
components: {

packages/mobile/components/loading/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212
import service from './src/service'
1313
import directive from './src/directive'
14-
import { setupComponent } from '../../../vue-common'
14+
import { setupComponent } from '../../vue-common'
1515

1616
const Loadings: any = {
1717
install(app) {

packages/mobile/components/modal/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*/
1212

13-
import { createComponent, setupComponent } from '../../../vue-common'
13+
import { createComponent, setupComponent } from '../../vue-common'
1414
import { MsgQueue } from './src/renderless'
1515
import TINYModal from './src/mobile.vue'
1616

packages/mobile/components/multi-select-item/src/mobile.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@
4949
</template>
5050

5151
<script lang="ts">
52-
import { $prefix, props, setup, defineComponent } from '../../../vue-common'
52+
import { $prefix, setup, defineComponent } from '../../../vue-common'
5353
import { renderless, api } from './renderless/vue'
5454
import { iconChevronDown } from '@opentiny/vue-icon'
55-
import Button from '@opentiny/vue-button'
55+
import Button from '../../button'
5656
import { multiSelectItemProps } from './multi-select-item'
5757
import '@opentiny/vue-theme-mobile/multi-select-item/index.less'
5858

packages/mobile/components/popover/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
*
1111
*/
1212
import Popover from './src/mobile.vue'
13-
import '@opentiny/vue-theme/popover/index.less'
1413

1514
/* istanbul ignore next */
1615
Popover.install = function (Vue) {

packages/mobile/components/tooltip/src/mobile.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ import {
2222
defineComponent,
2323
isEmptyVnode,
2424
hooks
25-
} from '../../..//vue-common'
26-
import '@opentiny/vue-theme/tooltip/index.less'
25+
} from '../../../vue-common'
2726
import type { ITooltipApi, ITinyVm } from './tooltip'
2827
import { tooltipProps } from './tooltip'
2928

packages/mobile/components/upload/src/mobile.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
-->
1212

1313
<script lang="tsx">
14-
import { $prefix, setup, h, defineComponent, props } from '@opentiny/vue-common'
14+
import { $prefix, setup, h, defineComponent } from '../../../vue-common'
1515

1616
// 此处引入 h 是为了防止打包后 h 被重命名导致组件报错的问题
1717
import { renderless, api } from './renderless/vue'
@@ -37,7 +37,6 @@ export default defineComponent({
3737
let {
3838
accept,
3939
disabled,
40-
drag,
4140
handleChange,
4241
handleClick,
4342
handlePaste,
@@ -46,7 +45,6 @@ export default defineComponent({
4645
listType,
4746
multiple,
4847
name,
49-
uploadFiles,
5048
fileList,
5149
limit,
5250
isHidden,

packages/mobile/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"@better-scroll/wheel": "^2.5.0",
3333
"@opentiny/vue-icon": "workspace:~",
3434
"@opentiny/mobile-utils": "workspace:~",
35+
"@opentiny/vue-theme-mobile": "workspace:~",
3536
"@opentiny/vue-locale": "workspace:~"
3637
},
3738
"devDependencies": {

packages/mobile/vite.config.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
import { defineConfig } from 'vite'
22
import vue from '@vitejs/plugin-vue'
33
import vueJsx from '@vitejs/plugin-vue-jsx'
4-
import dts from 'vite-plugin-dts'
54
import svgLoader from 'vite-svg-loader'
65

7-
// https://vitejs.dev/config/
86
export default defineConfig({
9-
plugins: [vue(), vueJsx(), dts(), svgLoader()],
7+
plugins: [vue(), vueJsx(), svgLoader()],
108
build: {
119
lib: {
1210
entry: './index.ts'
1311
},
14-
minify: true,
1512
rollupOptions: {
16-
external: [/@better-scroll/, /@opentiny/],
13+
external: [/@opentiny\/vue/, /@better-scroll/, 'vue', 'xss'],
1714
input: ['index.ts'],
1815
output: [
1916
{

packages/mobile/vue-common/index.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import {
2020
} from './src/adapter'
2121
import { t } from '@opentiny/vue-locale'
2222
import { stringifyCssClass, stringifyCssClassObject, stringifyCssClassArray, deduplicateCssClass } from './src/csscls'
23-
import '@opentiny/vue-theme/base/index.less'
2423
import { defineComponent, isVue2, isVue3 } from './src/adapter'
2524
import { useBreakpoint } from './src/breakpoint'
2625
import { useDefer } from './src/usedefer'
@@ -164,7 +163,6 @@ export const setup = ({ props, context, renderless, api, extendOptions = {}, cla
164163
const globalDesignConfig: DesignConfig = customDesignConfig.designConfig || hooks.inject(design.configKey, {})
165164
const designConfig = globalDesignConfig?.components?.[getComponentName().replace($prefix, '')]
166165

167-
const specifyPc = typeof process === 'object' ? process.env?.TINY_MODE : null
168166
const utils = {
169167
$prefix,
170168
t,
@@ -233,16 +231,14 @@ export function svg({ name = 'Icon', component }) {
233231
defineComponent({
234232
name: $prefix + name,
235233
setup: (props, context) => {
236-
const { fill, width, height, 'custom-class': customClass } = context.attrs || {}
234+
const { fill, width, height } = context.attrs || {}
237235
const mergeProps = Object.assign({}, props, propData || null)
238236
const mode = resolveMode(mergeProps, context)
239237
const isMobileFirst = mode === 'mobile-first'
240238
const tinyTag = { 'data-tag': isMobileFirst ? 'tiny-svg' : null }
241239
const attrs = isVue3 ? tinyTag : { attrs: tinyTag }
242240
let className = 'tiny-svg'
243241

244-
const specifyPc = typeof process === 'object' ? process.env?.TINY_MODE : null
245-
246242
const extend = Object.assign(
247243
{
248244
style: { fill, width, height },

0 commit comments

Comments
 (0)