Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GraceMonorepo
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
front-end
GraceMonorepo
Commits
1ef6f79e
Commit
1ef6f79e
authored
Nov 14, 2024
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
内置工具包built-in
埋点
parent
dc3067ee
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
16 deletions
+14
-16
Toast.module.less
packages/ui/src/components/Toast/Toast.module.less
+2
-4
Toast.tsx
packages/ui/src/components/Toast/Toast.tsx
+0
-2
vite.config.ts
packages/ui/vite.config.ts
+8
-8
HomeDemo.tsx
playground/src/pages/HomeDemo/HomeDemo.tsx
+4
-2
No files found.
packages/ui/src/components/Toast/Toast.module.less
View file @
1ef6f79e
...
@@ -21,15 +21,13 @@
...
@@ -21,15 +21,13 @@
display: inline-block;
display: inline-block;
position: relative;
position: relative;
top: 50%;
transform: translateY(-50%);
width: auto;
width: auto;
max-height: 70%;
max-height: 70%;
overflow: auto;
overflow: auto;
word-break: break-all;
word-break: break-all;
border-radius:
8
px;
border-radius:
12
px;
pointer-events: all;
pointer-events: all;
font-size:
var(--adm-font-size-7)
;
font-size:
24px
;
line-height: 1.5;
line-height: 1.5;
box-sizing: border-box;
box-sizing: border-box;
text-align: initial;
text-align: initial;
...
...
packages/ui/src/components/Toast/Toast.tsx
View file @
1ef6f79e
...
@@ -3,8 +3,6 @@ import React from 'react'
...
@@ -3,8 +3,6 @@ import React from 'react'
import
styles
from
'./Toast.module.less'
;
import
styles
from
'./Toast.module.less'
;
const
classPrefix
=
'__com_toast_'
;
export
interface
ToastProps
{
export
interface
ToastProps
{
afterClose
?:
()
=>
void
afterClose
?:
()
=>
void
visible
?:
boolean
visible
?:
boolean
...
...
packages/ui/vite.config.ts
View file @
1ef6f79e
...
@@ -3,6 +3,8 @@ import react from '@vitejs/plugin-react'
...
@@ -3,6 +3,8 @@ import react from '@vitejs/plugin-react'
import
dts
from
'vite-plugin-dts'
;
import
dts
from
'vite-plugin-dts'
;
import
{
libInjectCss
}
from
'vite-plugin-lib-inject-css'
;
// https://vite.dev/config/
// https://vite.dev/config/
export
default
defineConfig
(({
mode
}):
UserConfig
=>
{
export
default
defineConfig
(({
mode
}):
UserConfig
=>
{
...
@@ -12,7 +14,7 @@ export default defineConfig(({ mode }): UserConfig => {
...
@@ -12,7 +14,7 @@ export default defineConfig(({ mode }): UserConfig => {
build
:
{
build
:
{
cssCodeSplit
:
true
,
cssCodeSplit
:
true
,
sourcemap
:
isDev
,
sourcemap
:
isDev
,
target
:
'modules'
,
// target: "modules"
,
lib
:
{
lib
:
{
entry
:
"./src/index.tsx"
,
entry
:
"./src/index.tsx"
,
name
:
'UI'
,
name
:
'UI'
,
...
@@ -24,23 +26,21 @@ export default defineConfig(({ mode }): UserConfig => {
...
@@ -24,23 +26,21 @@ export default defineConfig(({ mode }): UserConfig => {
// 确保外部化处理那些你不想打包进库的依赖
// 确保外部化处理那些你不想打包进库的依赖
external
:
[
'react'
,
'react-dom'
,
"react/jsx-runtime"
],
external
:
[
'react'
,
'react-dom'
,
"react/jsx-runtime"
],
output
:
{
output
:
{
inlineDynamicImports
:
false
,
// 在 UMD 构建模式下为这些外部化的依赖提供一个全局变量
// 在 UMD 构建模式下为这些外部化的依赖提供一个全局变量
globals
:
{
globals
:
{
React
:
'react'
,
React
:
'react'
,
"react-dom"
:
'react-dom'
,
"react-dom"
:
'react-dom'
,
},
},
freeze
:
false
,
// preserveModules: true,
preserveModules
:
true
,
// preserveModulesRoot:'src',
preserveModulesRoot
:
'src'
,
// entryFileNames: "[name].js",
entryFileNames
:
"[name].js"
,
// exports: "named",
exports
:
"named"
,
},
},
},
},
},
},
plugins
:
[
plugins
:
[
react
(),
react
(),
//
libInjectCss(),
libInjectCss
(),
dts
({
tsconfigPath
:
'./tsconfig.app.json'
})
dts
({
tsconfigPath
:
'./tsconfig.app.json'
})
],
],
css
:
{
css
:
{
...
...
playground/src/pages/HomeDemo/HomeDemo.tsx
View file @
1ef6f79e
...
@@ -16,8 +16,10 @@ class HomeDemo extends React.Component {
...
@@ -16,8 +16,10 @@ class HomeDemo extends React.Component {
}
}
clickBtn
=
()
=>
{
clickBtn
=
()
=>
{
console
.
log
(
123123
)
Toast
.
show
({
Toast
.
show
(
'我是Toast
\
n我是Toast我是Toast我是Toast我是Toast我是Toast我是Toast我是Toast我是Toast我是Toast'
);
mask
:
true
,
content
:
'我是Toast
\
n我是Toast我是Toast我是Toast我是Toast我是Toast我是Toast我是Toast我是Toast我是Toast'
});
}
}
render
()
{
render
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment