From 2edd2092da31e8064464ec26cc8577c3f447d325 Mon Sep 17 00:00:00 2001 From: zq <136432190602163.com> Date: Thu, 10 Jul 2025 15:37:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0input=E3=80=81textarea?= =?UTF-8?q?=E3=80=81radio=E3=80=81formBtns=E3=80=81devicePreview=E3=80=81p?= =?UTF-8?q?rompText=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/package-lock.json | 35 +- examples/src/App.vue | 838 +++++++++++++++++++++++++++++++++-- examples/vue.config.js | 12 +- packages/DevicePreview/index.js | 7 + packages/DevicePreview/src/index.vue | 120 +++++ packages/GroupFormBtns/index.js | 7 + packages/GroupFormBtns/src/index.vue | 38 ++ packages/GuipButton/index.js | 8 +- packages/GuipInput/index.js | 7 + packages/GuipInput/src/index.vue | 150 +++++++ packages/GuipRadio/index.js | 7 + packages/GuipRadio/src/index.vue | 157 +++++++ packages/GuipTextarea/index.js | 7 + packages/GuipTextarea/src/index.vue | 90 ++++ packages/PromptText/index.js | 7 + packages/PromptText/src/index.vue | 101 +++++ packages/assets/form_linkActive.svg | 1 + packages/assets/prompt-icon-1.svg | 1 + packages/assets/prompt-icon-2.svg | 1 + packages/assets/prompt-icon-3.svg | 1 + packages/index.js | 26 +- packages/styles/common.scss | 1 - 22 files changed, 1561 insertions(+), 61 deletions(-) create mode 100644 packages/DevicePreview/index.js create mode 100644 packages/DevicePreview/src/index.vue create mode 100644 packages/GroupFormBtns/index.js create mode 100644 packages/GroupFormBtns/src/index.vue create mode 100644 packages/GuipInput/index.js create mode 100644 packages/GuipInput/src/index.vue create mode 100644 packages/GuipRadio/index.js create mode 100644 packages/GuipRadio/src/index.vue create mode 100644 packages/GuipTextarea/index.js create mode 100644 packages/GuipTextarea/src/index.vue create mode 100644 packages/PromptText/index.js create mode 100644 packages/PromptText/src/index.vue create mode 100644 packages/assets/form_linkActive.svg create mode 100644 packages/assets/prompt-icon-1.svg create mode 100644 packages/assets/prompt-icon-2.svg create mode 100644 packages/assets/prompt-icon-3.svg diff --git a/examples/package-lock.json b/examples/package-lock.json index ec34b5d..e86e87e 100644 --- a/examples/package-lock.json +++ b/examples/package-lock.json @@ -10,7 +10,7 @@ "dependencies": { "core-js": "^3.8.3", "element-ui": "^2.15.13", - "my-vue2-components": "file:../", + "my-components": "file:../", "vue": "^2.6.14", "vue-loader": "^17.4.2" }, @@ -28,18 +28,33 @@ } }, "..": { - "name": "my-components", - "version": "1.0.0", + "name": "@zhicheng1012/zhicheng-components", + "version": "1.0.1", "license": "MIT", - "dependencies": { - "vue": "^2.6.14" - }, "devDependencies": { - "css-loader": "^5.2.7", + "babel-eslint": "~10.1.0", + "css-loader": "~5.2.7", + "eslint": "~6.8.0", + "eslint-plugin-vue": "~6.2.2", + "file-loader": "^6.2.0", + "sass": "^1.89.2", + "sass-loader": "~10.2.0", + "style-loader": "~2.0.0", + "url-loader": "^4.1.1", + "vue": "^2.6.14", "vue-loader": "^15.9.8", + "vue-svg-loader": "^0.16.0", "vue-template-compiler": "^2.6.14", - "webpack": "^4.46.0", - "webpack-cli": "^4.9.2" + "webpack": "~4.46.0", + "webpack-cli": "~4.10.0" + }, + "engines": { + "node": ">=12.0.0 <=16.x", + "npm": ">=6.0.0" + }, + "peerDependencies": { + "element-ui": "^2.15.14", + "vue": "^2.6.14" } }, "node_modules/@achrinza/node-ipc": { @@ -11415,7 +11430,7 @@ "dev": true, "license": "ISC" }, - "node_modules/my-vue2-components": { + "node_modules/my-components": { "resolved": "..", "link": true }, diff --git a/examples/src/App.vue b/examples/src/App.vue index 1becdd8..73e351c 100644 --- a/examples/src/App.vue +++ b/examples/src/App.vue @@ -1,55 +1,809 @@ - - - - \ No newline at end of file +} + +.demo-section { + margin: 30px 0; + padding: 20px; + border: 1px solid #eee; + border-radius: 4px; +} + +h2 { + color: #333; + margin-bottom: 15px; + padding-bottom: 10px; + border-bottom: 1px solid #f0f0f0; +} + \ No newline at end of file diff --git a/examples/vue.config.js b/examples/vue.config.js index aa64dd7..ba20b44 100644 --- a/examples/vue.config.js +++ b/examples/vue.config.js @@ -1,3 +1,5 @@ +const path = require('path') + module.exports = { chainWebpack: config => { config.devServer.watchOptions({ @@ -5,5 +7,13 @@ module.exports = { poll: 1000 // 检查文件变化的频率 }) }, - lintOnSave: false + lintOnSave: false, + configureWebpack: { + resolve: { + alias: { + // 别名 + '@assets': path.resolve(__dirname, '../packages/assets') + } + } + } } \ No newline at end of file diff --git a/packages/DevicePreview/index.js b/packages/DevicePreview/index.js new file mode 100644 index 0000000..ca44ffa --- /dev/null +++ b/packages/DevicePreview/index.js @@ -0,0 +1,7 @@ +import DevicePreview from './src/index.vue' + +DevicePreview.install = function(Vue) { + Vue.component(DevicePreview.name || 'DevicePreview', DevicePreview) +} + +export default DevicePreview \ No newline at end of file diff --git a/packages/DevicePreview/src/index.vue b/packages/DevicePreview/src/index.vue new file mode 100644 index 0000000..599d641 --- /dev/null +++ b/packages/DevicePreview/src/index.vue @@ -0,0 +1,120 @@ + + + + + \ No newline at end of file diff --git a/packages/GroupFormBtns/index.js b/packages/GroupFormBtns/index.js new file mode 100644 index 0000000..b300ac0 --- /dev/null +++ b/packages/GroupFormBtns/index.js @@ -0,0 +1,7 @@ +import GroupFormBtns from './src/index.vue' + +GroupFormBtns.install = function(Vue) { + Vue.component(GroupFormBtns.name || 'GroupFormBtns', GroupFormBtns) +} + +export default GroupFormBtns \ No newline at end of file diff --git a/packages/GroupFormBtns/src/index.vue b/packages/GroupFormBtns/src/index.vue new file mode 100644 index 0000000..f7ab489 --- /dev/null +++ b/packages/GroupFormBtns/src/index.vue @@ -0,0 +1,38 @@ + + + + + \ No newline at end of file diff --git a/packages/GuipButton/index.js b/packages/GuipButton/index.js index 133a300..f44b89a 100644 --- a/packages/GuipButton/index.js +++ b/packages/GuipButton/index.js @@ -1,7 +1,7 @@ -import Button from './src/index.vue' +import GuipButton from './src/index.vue' -Button.install = function(Vue) { - Vue.component(Button.name || 'MyButton', Button) +GuipButton.install = function(Vue) { + Vue.component(GuipButton.name || 'GuipButton', GuipButton) } -export default Button \ No newline at end of file +export default GuipButton \ No newline at end of file diff --git a/packages/GuipInput/index.js b/packages/GuipInput/index.js new file mode 100644 index 0000000..83dbf7f --- /dev/null +++ b/packages/GuipInput/index.js @@ -0,0 +1,7 @@ +import GuipInput from './src/index.vue' + +GuipInput.install = function(Vue) { + Vue.component(GuipInput.name || 'GuipInput', GuipInput) +} + +export default GuipInput \ No newline at end of file diff --git a/packages/GuipInput/src/index.vue b/packages/GuipInput/src/index.vue new file mode 100644 index 0000000..2983dff --- /dev/null +++ b/packages/GuipInput/src/index.vue @@ -0,0 +1,150 @@ + + + + \ No newline at end of file diff --git a/packages/GuipRadio/index.js b/packages/GuipRadio/index.js new file mode 100644 index 0000000..f2e3e23 --- /dev/null +++ b/packages/GuipRadio/index.js @@ -0,0 +1,7 @@ +import GuipRadio from './src/index.vue' + +GuipRadio.install = function(Vue) { + Vue.component(GuipRadio.name || 'GuipRadio', GuipRadio) +} + +export default GuipRadio \ No newline at end of file diff --git a/packages/GuipRadio/src/index.vue b/packages/GuipRadio/src/index.vue new file mode 100644 index 0000000..05d2486 --- /dev/null +++ b/packages/GuipRadio/src/index.vue @@ -0,0 +1,157 @@ + + + + + \ No newline at end of file diff --git a/packages/GuipTextarea/index.js b/packages/GuipTextarea/index.js new file mode 100644 index 0000000..43cfd73 --- /dev/null +++ b/packages/GuipTextarea/index.js @@ -0,0 +1,7 @@ +import GuipTextarea from './src/index.vue' + +GuipTextarea.install = function(Vue) { + Vue.component(GuipTextarea.name || 'GuipTextarea', GuipTextarea) +} + +export default GuipTextarea \ No newline at end of file diff --git a/packages/GuipTextarea/src/index.vue b/packages/GuipTextarea/src/index.vue new file mode 100644 index 0000000..da427f8 --- /dev/null +++ b/packages/GuipTextarea/src/index.vue @@ -0,0 +1,90 @@ + + + \ No newline at end of file diff --git a/packages/PromptText/index.js b/packages/PromptText/index.js new file mode 100644 index 0000000..50c6797 --- /dev/null +++ b/packages/PromptText/index.js @@ -0,0 +1,7 @@ +import PromptText from './src/index.vue' + +PromptText.install = function(Vue) { + Vue.component(PromptText.name || 'PromptText', PromptText) +} + +export default PromptText \ No newline at end of file diff --git a/packages/PromptText/src/index.vue b/packages/PromptText/src/index.vue new file mode 100644 index 0000000..e6a10fc --- /dev/null +++ b/packages/PromptText/src/index.vue @@ -0,0 +1,101 @@ + + + \ No newline at end of file diff --git a/packages/assets/form_linkActive.svg b/packages/assets/form_linkActive.svg new file mode 100644 index 0000000..a6b2d92 --- /dev/null +++ b/packages/assets/form_linkActive.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/assets/prompt-icon-1.svg b/packages/assets/prompt-icon-1.svg new file mode 100644 index 0000000..377fc99 --- /dev/null +++ b/packages/assets/prompt-icon-1.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/assets/prompt-icon-2.svg b/packages/assets/prompt-icon-2.svg new file mode 100644 index 0000000..3789fbc --- /dev/null +++ b/packages/assets/prompt-icon-2.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/assets/prompt-icon-3.svg b/packages/assets/prompt-icon-3.svg new file mode 100644 index 0000000..98b0bdd --- /dev/null +++ b/packages/assets/prompt-icon-3.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/index.js b/packages/index.js index 888c653..33fe541 100644 --- a/packages/index.js +++ b/packages/index.js @@ -1,9 +1,23 @@ import GuipButton from './GuipButton' +import GroupFormBtns from './GroupFormBtns' +import GuipInput from './GuipInput' +import PromptText from './PromptText' +import GuipTextarea from './GuipTextarea' +import DevicePreview from './DevicePreview' +import GuipRadio from './GuipRadio' import './styles/index.css' // 全局引入 import './styles/common.scss' // 全局引入 -const components = [GuipButton] +const components = [ + GuipButton, + GroupFormBtns, + GuipInput, + PromptText, + GuipTextarea, + DevicePreview, + GuipRadio +] -const install = function(Vue) { +const install = function (Vue) { components.forEach(component => { Vue.component(component.name, component) }) @@ -11,5 +25,11 @@ const install = function(Vue) { export default { install, - GuipButton + GuipButton, + GroupFormBtns, + GuipInput, + PromptText, + GuipTextarea, + DevicePreview, + GuipRadio } \ No newline at end of file diff --git a/packages/styles/common.scss b/packages/styles/common.scss index 5d7421b..85a2675 100644 --- a/packages/styles/common.scss +++ b/packages/styles/common.scss @@ -674,7 +674,6 @@ body { .el-form-item.is-required:not(.is-no-asterisk)>.el-form-item__label::after { content: url(../assets/require.svg); display: inline-block; - background-image: url(../assets/require.svg); color: #ff4d4f; margin-right: 4px; margin-left: 4px;