dnhyxc-ui-vue 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/.prettierrc.json +22 -0
  2. package/docs/.vitepress/config.mts +55 -0
  3. package/docs/.vitepress/theme/index.ts +30 -0
  4. package/docs/.vitepress/theme/style.css +130 -0
  5. package/docs/api-examples.md +49 -0
  6. package/docs/auto-imports.d.ts +10 -0
  7. package/docs/components/icon.md +75 -0
  8. package/docs/components.d.ts +13 -0
  9. package/docs/guide/installation.md +1 -0
  10. package/docs/guide/quick-start.md +1 -0
  11. package/docs/index.md +24 -0
  12. package/docs/markdown-examples.md +85 -0
  13. package/docs/package.json +30 -0
  14. package/docs/vite.config.ts +20 -0
  15. package/eslint.config.mjs +90 -0
  16. package/package.json +78 -0
  17. package/packages/components/button/index.ts +13 -0
  18. package/packages/components/button/src/button.ts +20 -0
  19. package/packages/components/button/src/button.vue +39 -0
  20. package/packages/components/button/src/index.scss +3 -0
  21. package/packages/components/icon/index.ts +14 -0
  22. package/packages/components/icon/src/icon.ts +16 -0
  23. package/packages/components/icon/src/icon.vue +35 -0
  24. package/packages/components/icon2/index.ts +14 -0
  25. package/packages/components/icon2/src/icon2.ts +16 -0
  26. package/packages/components/icon2/src/icon2.vue +35 -0
  27. package/packages/components/index.ts +5 -0
  28. package/packages/components/input/index.ts +13 -0
  29. package/packages/components/input/src/index.scss +3 -0
  30. package/packages/components/input/src/input.ts +22 -0
  31. package/packages/components/input/src/input.vue +50 -0
  32. package/packages/components/monaco/index.ts +8 -0
  33. package/packages/components/monaco/src/custom.ts +124 -0
  34. package/packages/components/monaco/src/index.scss +235 -0
  35. package/packages/components/monaco/src/monaco.ts +46 -0
  36. package/packages/components/monaco/src/monaco.vue +472 -0
  37. package/packages/components/package.json +29 -0
  38. package/packages/components/tsconfig.json +34 -0
  39. package/packages/components/tsconfig.tsbuildinfo +1 -0
  40. package/packages/script/build/build.ts +90 -0
  41. package/packages/script/build/buildfull.ts +77 -0
  42. package/packages/script/build/external.ts +21 -0
  43. package/packages/script/build/index.ts +22 -0
  44. package/packages/script/utils/delPath.ts +30 -0
  45. package/packages/script/utils/paths.ts +7 -0
  46. package/packages/theme/gulpfile.js +41 -0
  47. package/packages/theme/package.json +16 -0
  48. package/packages/theme/src/icon.scss +8 -0
  49. package/packages/theme/src/icon2.scss +8 -0
  50. package/packages/theme/src/index.scss +2 -0
  51. package/packages/theme/src/mixins/config.scss +4 -0
  52. package/packages/theme/src/mixins/mixins.scss +80 -0
  53. package/packages/utils/bem.ts +60 -0
  54. package/packages/utils/index.ts +2 -0
  55. package/packages/utils/package.json +16 -0
  56. package/packages/utils/vite.config.ts +61 -0
  57. package/packages/utils/with-install.ts +12 -0
  58. package/play/.vscode/extensions.json +3 -0
  59. package/play/README.md +5 -0
  60. package/play/auto-imports.d.ts +10 -0
  61. package/play/components.d.ts +14 -0
  62. package/play/index.html +13 -0
  63. package/play/package.json +30 -0
  64. package/play/public/vite.svg +1 -0
  65. package/play/src/App.vue +32 -0
  66. package/play/src/assets/vue.svg +1 -0
  67. package/play/src/components/MyInput.vue +25 -0
  68. package/play/src/main.ts +12 -0
  69. package/play/src/vite-env.d.ts +7 -0
  70. package/play/tsconfig.app.json +14 -0
  71. package/play/tsconfig.json +7 -0
  72. package/play/tsconfig.node.json +24 -0
  73. package/play/vite.config.ts +20 -0
  74. package/pnpm-workspace.yaml +5 -0
  75. package/tsconfig.json +35 -0
@@ -0,0 +1,77 @@
1
+ import { defineConfig } from 'vite';
2
+ // import { rmSync } from 'fs';
3
+ import vue from '@vitejs/plugin-vue';
4
+ // import AutoImport from 'unplugin-auto-import/vite';
5
+ // import Components from 'unplugin-vue-components/vite';
6
+ // import { ElementPlusResolver } from 'unplugin-vue-components/resolvers';
7
+ // import path from 'path';
8
+ import dts from 'vite-plugin-dts';
9
+ import { external } from './external';
10
+
11
+ // 打包前先删除 dist 目录
12
+ // rmSync('dist', { recursive: true, force: true });
13
+
14
+ // 组件库打包配置
15
+ export default defineConfig({
16
+ build: {
17
+ // 打包输出目录
18
+ outDir: 'dist',
19
+ // 构建库模式
20
+ lib: {
21
+ // 组件库入口文件
22
+ entry: '',
23
+ // 输出格式
24
+ formats: ['es', 'umd']
25
+ // // 输出文件名
26
+ // fileName: (format) => `index.${format}.js`,
27
+ // // 在 UMD 构建模式下为这个包指定一个全局变量名称
28
+ // name: 'dnhyxc-ui-plus'
29
+ },
30
+ rollupOptions: {
31
+ // 外部化处理依赖
32
+ external,
33
+ input: ['./index.ts'],
34
+ output: [
35
+ {
36
+ // 输出文件名格式
37
+ entryFileNames: '[name].mjs',
38
+ // 输出格式为 ES Module
39
+ format: 'es',
40
+ // ES Module 格式文件的输出目录
41
+ // dir: './dist',
42
+ chunkFileNames: 'dist/index.mjs',
43
+ // 保持目录结构
44
+ // preserveModules: true,
45
+ // 指定输出文件的根目录,将所有模块放在 components 目录下,这样可以保持更清晰的目录结构
46
+ // preserveModulesRoot: 'src',
47
+ assetFileNames: 'index.[ext]'
48
+ },
49
+ {
50
+ entryFileNames: '[name].js',
51
+ chunkFileNames: 'dist/index.cjs',
52
+ format: 'cjs',
53
+ name: 'dnhyxc-ui-plus',
54
+ // 输出文件夹
55
+ dir: './dist',
56
+ // 保持目录结构
57
+ // preserveModules: true,
58
+ // // 输出目录
59
+ // preserveModulesRoot: 'src',
60
+ assetFileNames: 'index.[ext]'
61
+ // UMD格式下需要指定全局变量名, 这样在浏览器中通过 <script> 标签引入时,就会从 window.Vue 获取 Vue 依赖
62
+ // globals: {
63
+ // vue: 'Vue'
64
+ // }
65
+ }
66
+ ]
67
+ }
68
+ },
69
+ plugins: [
70
+ vue(),
71
+ // 生成组件的类型声明文件
72
+ dts({
73
+ include: ['./**/*'],
74
+ outDir: ['./dist']
75
+ })
76
+ ]
77
+ });
@@ -0,0 +1,21 @@
1
+ export const external = [
2
+ 'vue',
3
+ 'node_modules',
4
+ '@dnhyxc-ui/utils',
5
+ 'element-plus',
6
+ 'element-plus/dist/index.css',
7
+ 'monaco-editor',
8
+ 'monaco-editor/esm/vs/editor/editor.api.js',
9
+ 'monaco-editor/esm/vs/language/json/json.worker?worker',
10
+ 'monaco-editor/esm/vs/language/css/css.worker?worker',
11
+ 'monaco-editor/esm/vs/language/html/html.worker?worker',
12
+ 'monaco-editor/esm/vs/language/typescript/ts.worker?worker',
13
+ 'monaco-editor/esm/vs/editor/editor.worker?worker',
14
+ 'prettier/parser-markdown',
15
+ 'prettier/parser-babel',
16
+ 'prettier/parser-typescript',
17
+ 'prettier/parser-html',
18
+ 'prettier/parser-yaml',
19
+ 'prettier/parser-postcss',
20
+ 'prettier'
21
+ ];
@@ -0,0 +1,22 @@
1
+ import { series, parallel, src, dest } from 'gulp';
2
+ import { componentPath } from '../utils/paths';
3
+ import glupSass from 'gulp-sass';
4
+ import * as dartSass from 'sass';
5
+ import autoprefixer from 'gulp-autoprefixer';
6
+ import cleanCSS from 'gulp-clean-css';
7
+
8
+ //打包样式
9
+ export const buildStyle = () => {
10
+ return src(`${componentPath}/**/**.scss`)
11
+ .pipe(glupSass(dartSass)())
12
+ .pipe(
13
+ autoprefixer(
14
+ { cascade: false } //文件不缓存
15
+ )
16
+ )
17
+ .pipe(cleanCSS({ compatibility: 'ie8' })) // 压缩css文件
18
+ .pipe(dest(`${componentPath}/es`))
19
+ .pipe(dest(`${componentPath}/lib`));
20
+ };
21
+
22
+ export default series(parallel(async () => buildStyle()));
@@ -0,0 +1,30 @@
1
+ import fs from 'fs';
2
+ import { resolve } from 'path';
3
+ import { pkgPath } from './paths';
4
+ //保留的文件
5
+ const stayFile = ['README.md'];
6
+
7
+ const delPath = async (path: string) => {
8
+ let files: string[] = [];
9
+
10
+ if (fs.existsSync(path)) {
11
+ files = fs.readdirSync(path);
12
+
13
+ files.forEach(async (file) => {
14
+ let curPath = resolve(path, file);
15
+
16
+ if (fs.statSync(curPath).isDirectory()) {
17
+ // recurse
18
+ if (file != 'node_modules') await delPath(curPath);
19
+ } else {
20
+ // delete file
21
+ if (!stayFile.includes(file)) {
22
+ fs.unlinkSync(curPath);
23
+ }
24
+ }
25
+ });
26
+
27
+ if (path != `${pkgPath}/dnhyxc-ui-plus`) fs.rmdirSync(path);
28
+ }
29
+ };
30
+ export default delPath;
@@ -0,0 +1,7 @@
1
+ import { resolve } from 'path';
2
+
3
+ //组件库根目录
4
+ export const componentPath = resolve(__dirname, '../../components');
5
+
6
+ //pkg根目录
7
+ export const pkgPath = resolve(__dirname, '../../../');
@@ -0,0 +1,41 @@
1
+ 'use strict';
2
+
3
+ import gulp from 'gulp';
4
+ import autoprefixer from 'gulp-autoprefixer';
5
+ // const sass = require('gulp-sass')(require('sass'));
6
+ import gulpSass from 'gulp-sass';
7
+ import * as sass from 'sass';
8
+ // import cssmin from 'gulp-cssmin';
9
+ import cleanCSS from 'gulp-clean-css';
10
+
11
+ const _sass = gulpSass(sass);
12
+
13
+ // // import autoprefixer from 'gulp-autoprefixer';
14
+ // // import cssmin from 'gulp-cssmin';
15
+ // const gulp = require('gulp'); // gulp 编译 scss文件的插件
16
+ // const sass = require('gulp-sass')(require('sass')); // gulp 编译 scss文件的插件
17
+ // const autoprefixer = require('gulp-autoprefixer'); // 根据设置浏览器版本自动处理浏览器前缀的插件
18
+ // const cssmin = require('gulp-cssmin'); // 压缩css文件的插件
19
+
20
+ gulp.task('sass', function () {
21
+ // 新建 compile 任务
22
+ return gulp
23
+ .src('./src/*.scss') // 匹配所有的 src目录下的 scss 文件
24
+ .pipe(_sass())
25
+ .pipe(
26
+ autoprefixer({
27
+ // 设置浏览器自动前缀
28
+ cascade: false //文件不缓存
29
+ })
30
+ )
31
+ .pipe(cleanCSS({ compatibility: 'ie8' })) // 压缩css文件
32
+ .pipe(gulp.dest('./dist')); //将编译后的文件放在 lib 目录下
33
+ });
34
+
35
+ // gulp.task('copyfont', function () {
36
+ // // iconfont 图标编译任务
37
+ // return gulp
38
+ // .src('./src/fonts/**') // 匹配 iconfont 目录下的所有文件
39
+ // .pipe(cssmin()) // 压缩匹配文件
40
+ // .pipe(gulp.dest('./lib/fonts')); // 将文件输出带 lib/fonts 目录下
41
+ // });
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "@dnhyxc-ui/theme",
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "scripts": {
6
+ "build": "gulp sass"
7
+ },
8
+ "keywords": [],
9
+ "author": "",
10
+ "license": "ISC",
11
+ "description": "",
12
+ "browserslist": [
13
+ "last 2 versions",
14
+ "ie >= 9"
15
+ ]
16
+ }
@@ -0,0 +1,8 @@
1
+ @use 'mixins/mixins.scss' as *;
2
+
3
+ @include b(icon) {
4
+ display: inline-flex;
5
+ height: 1em;
6
+ width: 1em;
7
+ vertical-align: middle;
8
+ }
@@ -0,0 +1,8 @@
1
+ @use 'mixins/mixins.scss' as *;
2
+
3
+ @include b(icon2) {
4
+ display: inline-flex;
5
+ height: 1em;
6
+ width: 1em;
7
+ vertical-align: middle;
8
+ }
@@ -0,0 +1,2 @@
1
+ @use './icon.scss';
2
+ @use './icon2.scss';
@@ -0,0 +1,4 @@
1
+ $namespace: 'n';
2
+ $element-separator: '__';
3
+ $modifier-separator: '--';
4
+ $state-prefix: 'is-';
@@ -0,0 +1,80 @@
1
+ @use 'config' as *;
2
+ @forward 'config';
3
+
4
+ /**
5
+ * 用于定义组件的基础样式
6
+ * @param {string} $block - 组件名称
7
+ * @example
8
+ * @include b(button) {
9
+ * color: red;
10
+ * }
11
+ * 编译后:
12
+ * .el-button {
13
+ * color: red;
14
+ * }
15
+ */
16
+ @mixin b($block) {
17
+ $B: $namespace + '-' + $block;
18
+ .#{$B} {
19
+ @content;
20
+ }
21
+ }
22
+ /**
23
+ * 用于定义组件的状态样式
24
+ * @param {string} $state - 状态名称
25
+ * @example
26
+ * @include when(active) {
27
+ * color: red;
28
+ * }
29
+ * 编译后:
30
+ * &.is-active {
31
+ * color: red;
32
+ * }
33
+ */
34
+ @mixin when($state) {
35
+ @at-root {
36
+ &.#{$state-prefix + $state} {
37
+ @content;
38
+ }
39
+ }
40
+ }
41
+
42
+ /**
43
+ * 用于定义组件的修饰符样式
44
+ * @param {string} $modifier - 修饰符名称
45
+ * @example
46
+ * @include m(primary) {
47
+ * color: red;
48
+ * }
49
+ * 编译后:
50
+ * .el-button--primary {
51
+ * color: red;
52
+ * }
53
+ */
54
+ @mixin m($modifier) {
55
+ @at-root {
56
+ #{& + $modifier-separator + $modifier} {
57
+ @content;
58
+ }
59
+ }
60
+ }
61
+
62
+ /**
63
+ * 用于定义组件的元素样式
64
+ * @param {string} $element - 元素名称
65
+ * @example
66
+ * @include e(header) {
67
+ * color: red;
68
+ * }
69
+ * 编译后:
70
+ * .el-button__header {
71
+ * color: red;
72
+ * }
73
+ */
74
+ @mixin e($element) {
75
+ @at-root {
76
+ #{& + $element-separator + $element} {
77
+ @content;
78
+ }
79
+ }
80
+ }
@@ -0,0 +1,60 @@
1
+ // bem 规范 block 代码块 element 元素 modifier 装饰
2
+ // n-button n-button--primary n-button--disabled
3
+ const _bem = (prefix: string, blockSuffix: string, element: string, modifier: string) => {
4
+ if (blockSuffix) {
5
+ prefix += `-${blockSuffix}`;
6
+ }
7
+ if (element) {
8
+ prefix += `__${element}`;
9
+ }
10
+ if (modifier) {
11
+ prefix += `--${modifier}`;
12
+ }
13
+ return prefix;
14
+ };
15
+
16
+ const createBEM = (prefix: string = '') => {
17
+ const b = (blockSuffix: string = '') => _bem(prefix, blockSuffix, '', '');
18
+
19
+ const e = (element: string = '') => (element ? _bem(prefix, '', element, '') : '');
20
+
21
+ const m = (modifier: string = '') => (modifier ? _bem(prefix, '', '', modifier) : '');
22
+
23
+ const be = (blockSuffix: string = '', element: string = '') =>
24
+ blockSuffix && element ? _bem(prefix, blockSuffix, element, '') : '';
25
+
26
+ const em = (element: string = '', modifier: string = '') =>
27
+ element && modifier ? _bem(prefix, '', element, modifier) : '';
28
+
29
+ const bm = (blockSuffix: string = '', modifier: string = '') =>
30
+ blockSuffix && modifier ? _bem(prefix, blockSuffix, '', modifier) : '';
31
+
32
+ const bem = (blockSuffix: string = '', element: string = '', modifier: string = '') =>
33
+ blockSuffix && element && modifier ? _bem(prefix, blockSuffix, element, modifier) : '';
34
+
35
+ const is = (name: string, status: boolean) => (status ? `is-${name}` : '');
36
+
37
+ return {
38
+ b,
39
+ e,
40
+ m,
41
+ be,
42
+ em,
43
+ bm,
44
+ bem,
45
+ is
46
+ };
47
+ };
48
+
49
+ export const createNamespace = (name: string) => {
50
+ const prefix = `n-${name}`;
51
+ return createBEM(prefix);
52
+ };
53
+
54
+ // const bem = createNamespace('button');
55
+ // console.log(bem.b('box'));
56
+ // console.log(bem.e('element'));
57
+ // console.log(bem.m('modifer'));
58
+ // console.log(bem.is('checked', true));
59
+ // console.log(bem.be('box', 'element'));
60
+ // console.log(bem.bem('box', 'element', 'modifer'));
@@ -0,0 +1,2 @@
1
+ export * from './bem';
2
+ export * from './with-install';
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "@dnhyxc-ui/utils",
3
+ "version": "1.0.0",
4
+ "main": "dist/index.js",
5
+ "types": "dist/index.d.ts",
6
+ "files": [
7
+ "dist"
8
+ ],
9
+ "scripts": {
10
+ "build": "vite build"
11
+ },
12
+ "keywords": [],
13
+ "author": "",
14
+ "license": "ISC",
15
+ "description": ""
16
+ }
@@ -0,0 +1,61 @@
1
+ import { defineConfig } from 'vite';
2
+ import { rmSync } from 'fs';
3
+ import dts from 'vite-plugin-dts';
4
+
5
+ // 打包前先删除 dist 目录
6
+ rmSync('dist', { recursive: true, force: true });
7
+
8
+ // 组件库打包配置
9
+ export default defineConfig({
10
+ build: {
11
+ // 打包输出目录
12
+ outDir: 'es',
13
+ // 构建库模式
14
+ lib: {
15
+ // 组件库入口文件
16
+ entry: './index.ts'
17
+ // // 输出格式
18
+ // formats: ['es']
19
+ },
20
+ rollupOptions: {
21
+ // 外部化处理依赖
22
+ input: ['./index.ts'],
23
+ output: [
24
+ {
25
+ // 输出文件名格式
26
+ entryFileNames: '[name].js',
27
+ // 输出格式为 ES Module
28
+ format: 'es',
29
+ // ES Module 格式文件的输出目录
30
+ dir: 'dist',
31
+ // 保持目录结构
32
+ preserveModules: true,
33
+ // 指定输出文件的根目录,将所有模块放在 components 目录下,这样可以保持更清晰的目录结构
34
+ preserveModulesRoot: 'src'
35
+ }
36
+ // {
37
+ // entryFileNames: '[name].js',
38
+ // format: 'cjs',
39
+ // name: 'dnhyxc-ui',
40
+ // // 输出文件夹
41
+ // dir: 'dist/lib',
42
+ // // 保持目录结构
43
+ // preserveModules: true,
44
+ // // 输出目录
45
+ // preserveModulesRoot: 'src'
46
+ // // UMD格式下需要指定全局变量名, 这样在浏览器中通过 <script> 标签引入时,就会从 window.Vue 获取 Vue 依赖
47
+ // // globals: {
48
+ // // vue: 'Vue'
49
+ // // }
50
+ // }
51
+ ]
52
+ }
53
+ },
54
+ plugins: [
55
+ // 生成组件的类型声明文件
56
+ dts({
57
+ include: ['./**/*'],
58
+ outDir: ['dist']
59
+ })
60
+ ]
61
+ });
@@ -0,0 +1,12 @@
1
+ import { type Plugin, type App } from 'vue';
2
+
3
+ export type SFCWithInstall<T> = T & Plugin;
4
+
5
+ // 为组件增加install方法,使组件及可以通过 use 方式注册为全局组件,也可以通过 import 方式单独使用
6
+ export const withInstall = <T>(comp: T) => {
7
+ const c = comp as unknown as { name: string };
8
+ (comp as SFCWithInstall<T>).install = (app: App) => {
9
+ app.component(c.name, c);
10
+ };
11
+ return comp as SFCWithInstall<T>;
12
+ };
@@ -0,0 +1,3 @@
1
+ {
2
+ "recommendations": ["Vue.volar"]
3
+ }
package/play/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # Vue 3 + TypeScript + Vite
2
+
3
+ This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
4
+
5
+ Learn more about the recommended Project Setup and IDE Support in the [Vue Docs TypeScript Guide](https://vuejs.org/guide/typescript/overview.html#project-setup).
@@ -0,0 +1,10 @@
1
+ /* eslint-disable */
2
+ /* prettier-ignore */
3
+ // @ts-nocheck
4
+ // noinspection JSUnusedGlobalSymbols
5
+ // Generated by unplugin-auto-import
6
+ // biome-ignore lint: disable
7
+ export {}
8
+ declare global {
9
+
10
+ }
@@ -0,0 +1,14 @@
1
+ /* eslint-disable */
2
+ // @ts-nocheck
3
+ // Generated by unplugin-vue-components
4
+ // Read more: https://github.com/vuejs/core/pull/3399
5
+ // biome-ignore lint: disable
6
+ export {}
7
+
8
+ /* prettier-ignore */
9
+ declare module 'vue' {
10
+ export interface GlobalComponents {
11
+ ElButton: typeof import('element-plus/es')['ElButton']
12
+ MyInput: typeof import('./src/components/MyInput.vue')['default']
13
+ }
14
+ }
@@ -0,0 +1,13 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Vite + Vue + TS</title>
8
+ </head>
9
+ <body>
10
+ <div id="app"></div>
11
+ <script type="module" src="/src/main.ts"></script>
12
+ </body>
13
+ </html>
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "play",
3
+ "private": true,
4
+ "version": "0.0.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "build": "vue-tsc -b && vite build",
9
+ "preview": "vite preview"
10
+ },
11
+ "dependencies": {
12
+ "@dnhyxc-ui/theme": "workspace:^",
13
+ "@vicons/ionicons5": "^0.13.0",
14
+ "dnhyxc-ui-plus": "workspace:^",
15
+ "element-plus": "^2.10.3",
16
+ "vue": "^3.5.13"
17
+ },
18
+ "devDependencies": {
19
+ "@vitejs/plugin-vue": "^5.2.1",
20
+ "@vue/tsconfig": "^0.7.0",
21
+ "sass-embedded": "^1.89.2",
22
+ "scss": "^0.2.4",
23
+ "typescript": "~5.7.2",
24
+ "unplugin-auto-import": "^19.3.0",
25
+ "unplugin-element-plus": "^0.10.0",
26
+ "unplugin-vue-components": "^28.8.0",
27
+ "vite": "^7.0.0",
28
+ "vue-tsc": "^2.2.0"
29
+ }
30
+ }
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -0,0 +1,32 @@
1
+ <script setup lang="ts">
2
+ import { NButton, NMonaco } from 'dnhyxc-ui-plus';
3
+ import { Earth } from '@vicons/ionicons5';
4
+ import MyInput from './components/MyInput.vue';
5
+ // import 'dnhyxc-ui-plus/es/button/src/index.css';
6
+ // import 'dnhyxc-ui-plus/es/input/src/index.css';
7
+ </script>
8
+
9
+ <template>
10
+ <div>
11
+ <h1>test play</h1>
12
+ <NButton type="primary" size="large" :disabled="false" class="my-inp">这是自定义按钮</NButton>
13
+ <MyInput />
14
+ <NMonaco code="测试输入内容" theme="vs" />
15
+ <!-- <el-button>这是 element-plus button</el-button> -->
16
+ <n-icon :size="20" color="red">
17
+ <Earth />
18
+ </n-icon>
19
+ <n-icon :size="20" color="skyblue">
20
+ <Earth />
21
+ </n-icon>
22
+ <n-icon2 :size="50" color="pink">
23
+ <Earth />
24
+ </n-icon2>
25
+ </div>
26
+ </template>
27
+
28
+ <style scoped lang="scss">
29
+ .my-inp {
30
+ margin-top: 20px;
31
+ }
32
+ </style>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="37.07" height="36" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 198"><path fill="#41B883" d="M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0h47.36Z"></path><path fill="#41B883" d="m0 0l128 220.8L256 0h-51.2L128 132.48L50.56 0H0Z"></path><path fill="#35495E" d="M50.56 0L128 133.12L204.8 0h-47.36L128 51.2L97.92 0H50.56Z"></path></svg>
@@ -0,0 +1,25 @@
1
+ <script setup lang="ts">
2
+ import { ref, watch } from 'vue';
3
+ import { NInput } from 'dnhyxc-ui-plus';
4
+ // import 'dnhyxc-ui-plus/es/button/src/index.css';
5
+ // import 'dnhyxc-ui-plus/es/input/src/index.css';
6
+
7
+ const keyword = ref('');
8
+
9
+ watch(keyword, (newValue, oldValue) => {
10
+ console.log('newValue', newValue);
11
+ console.log('oldValue', oldValue);
12
+ });
13
+ </script>
14
+
15
+ <template>
16
+ <div>
17
+ <NInput v-model:value="keyword" size="large" class="my-inp" placeholder="请输入" />
18
+ </div>
19
+ </template>
20
+
21
+ <style scoped lang="scss">
22
+ .my-inp {
23
+ margin-top: 50px;
24
+ }
25
+ </style>
@@ -0,0 +1,12 @@
1
+ import { createApp } from 'vue';
2
+ import ElementPlus from 'element-plus';
3
+ // import 'element-plus/dist/index.css';
4
+ import App from './App.vue';
5
+ import { NInput } from 'dnhyxc-ui-plus';
6
+ import 'dnhyxc-ui-plus/es/index.css';
7
+ // import 'dnhyxc-ui/dist/style/theme-chalk.css';
8
+
9
+ const app = createApp(App);
10
+ app.use(ElementPlus);
11
+ app.use(NInput);
12
+ app.mount('#app');
@@ -0,0 +1,7 @@
1
+ /// <reference types="vite/client" />
2
+
3
+ declare module '*.vue' {
4
+ import type { DefineComponent } from 'vue';
5
+ const component: DefineComponent<{}, {}, any>;
6
+ export default component;
7
+ }