Commit 1ef6f79e authored by haiyoucuv's avatar haiyoucuv

内置工具包built-in

埋点
parent dc3067ee
...@@ -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: 8px; border-radius: 12px;
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;
......
...@@ -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
......
...@@ -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: {
......
...@@ -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() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment