diff --git a/app/main.js b/app/main.js index 2552eda..d4ad056 100644 --- a/app/main.js +++ b/app/main.js @@ -14,7 +14,13 @@ import './theme/index.css' import 'codemirror/theme/cobalt.css' import 'codemirror/mode/javascript/javascript.js' -import SchemaForm, { SchemaFormItem, SchemaFormJsoneditor, SchemaFormQuill, SchemaFormCodemirror } from '../src/index' +import SchemaForm, { + SchemaFormItem, + SchemaFormJsoneditor, + SchemaFormQuill, + SchemaFormCodemirror +} from '../src/index' +// } from '../lib/element-schema-form.common' Vue.use(ElementUI, { size: 'small' diff --git a/app/store/global-actions.js b/app/store/global-actions.js index 8a77090..da57c02 100644 --- a/app/store/global-actions.js +++ b/app/store/global-actions.js @@ -2,6 +2,10 @@ import types from './mutation-types' import Immutable from 'immutable' import shortid from 'js-shortid' +const makeAction = type => { + return ({ commit }, ...args) => commit(type, ...args) +} + export default { addRow ({ commit, state }, reload) { let { layoutSections } = state @@ -67,7 +71,7 @@ export default { let _list = Immutable.fromJS(layoutSections) commit(types.UPDATE_LAYOUT_SECTIONS, _list.set(activeSection, newVal).toJS()) }, - async delteColComp ({ commit, state, dispatch }, { colIndex, newVal, prop }) { + async deleteColComp ({ commit, state, dispatch }, { colIndex, newVal, prop }) { let { layoutSections, activeSection } = state let _list = Immutable.fromJS(layoutSections) console.log(1) @@ -123,5 +127,6 @@ export default { ] }) } commit(types.UPDATE_ACTIVE_PROP, `default_${_propIdx}`) - } + }, + resetGlobalStore: makeAction('RESET_GLOBAL_STORE') } diff --git a/app/store/global-mutations.js b/app/store/global-mutations.js index 9e1223e..4612f06 100644 --- a/app/store/global-mutations.js +++ b/app/store/global-mutations.js @@ -30,5 +30,29 @@ export default { }, [types.UPDATE_FORM_CONTROL] (state, load) { state.formControl = Object.assign(state.formControl, load) + }, + [types.RESET_GLOBAL_STORE](state, load) { + const originState = { + iterationIdx: 0, // 迭代指针 + layoutSections: [], // schema 信息 + formModel: {}, + formOptions: {}, + formLayout: { // 表单布局 + gutter: 16, + justify: 'start' + }, + formSettings: { // 表单属性 + labelPosition: 'left', + size: 'small', + labelWidth: '80px' + }, + formControl: { // 布局控制 + showGrid: false, + showLayout: false + }, + activeSection: 0, // 激活的行数 + activeProp: '' // 激活的组件prop + } + state = Object.assign(state, originState) } } diff --git a/app/store/mutation-types.js b/app/store/mutation-types.js index 26a1a2c..5eb4826 100644 --- a/app/store/mutation-types.js +++ b/app/store/mutation-types.js @@ -7,5 +7,6 @@ export default { UPDATE_ITERATION_IDX: 'UPDATE_ITERATION_IDX', UPDATE_FORM_SETTING: 'UPDATE_FORM_SETTING', UPDATE_FORM_LAYOUT: 'UPDATE_FORM_LAYOUT', - UPDATE_FORM_CONTROL: 'UPDATE_FORM_CONTROL' + UPDATE_FORM_CONTROL: 'UPDATE_FORM_CONTROL', + RESET_GLOBAL_STORE: 'RESET_GLOBAL_STORE' } diff --git a/app/views/form-generator/aside-panel/index.vue b/app/views/form-generator/aside-panel/index.vue index 6288a2a..6254923 100644 --- a/app/views/form-generator/aside-panel/index.vue +++ b/app/views/form-generator/aside-panel/index.vue @@ -99,7 +99,7 @@ export default { 'editRow', 'deleteRow', 'changeRow', - 'delteColComp' + 'deleteColComp' ]), checkMove (e) { console.log('Future index: ' + e.draggedContext.futureIndex) @@ -109,7 +109,7 @@ export default { isCustom: 'btn-addCol', colGrid: element.colGrid } - this.delteColComp({ colIndex, newVal: oldSection, prop: element.prop }) + this.deleteColComp({ colIndex, newVal: oldSection, prop: element.prop }) }, onAddRow (data) { const initVal = data.map((val, idx) => { diff --git a/app/views/form-generator/config-panel/module/component-panel.vue b/app/views/form-generator/config-panel/module/component-panel.vue index 7dcf445..0461c5a 100644 --- a/app/views/form-generator/config-panel/module/component-panel.vue +++ b/app/views/form-generator/config-panel/module/component-panel.vue @@ -5,15 +5,15 @@
通用属性
- - - - - - - - - + + + + + + + + +
diff --git a/app/views/form-generator/dialog/PreviewForm.vue b/app/views/form-generator/dialog/PreviewForm.vue index 771c0a3..7d7b25c 100644 --- a/app/views/form-generator/dialog/PreviewForm.vue +++ b/app/views/form-generator/dialog/PreviewForm.vue @@ -19,7 +19,7 @@ :options="options" > - + diff --git a/app/views/form-generator/index.vue b/app/views/form-generator/index.vue index 06e5f92..7beeda6 100644 --- a/app/views/form-generator/index.vue +++ b/app/views/form-generator/index.vue @@ -11,6 +11,7 @@ 生成 Schema 生成 Vue 代码 预览表单 + 重置表单 CNAME + +# git init +git add -A +git commit -m 'chore: deploy docs' + +# 如果发布到 https://.github.io +# git push -f git@github.com:/.github.io.git master + +# 如果发布到 https://.github.io/ +# git push -f git@github.com:/.git master:gh-pages + +cd - \ No newline at end of file diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 3ecbaf1..1f20244 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -1,7 +1,7 @@ module.exports = { - title: 'Element Form Generator', - description: '基于 Element 的表单设计器,表单开发利器。', - base: '/docs/', + title: 'Element Schema Form', + description: '基于 JSON Schema 构建 Element 表单', + base: '/element-schema-form/', port: 5454, themeConfig: { sidebarDepth: 2, @@ -24,7 +24,7 @@ module.exports = { title: '指南', collapsable: false, children: [ - '/guide/', + '', '快速开始', '更新日志', '在线示例', @@ -33,8 +33,11 @@ module.exports = { { title: '组件', collapsable: false, + sidebarDepth: 1, children: [ '/guide/component/SchemaForm', + ['/guide/component/schema', 'schema 详解'], + ['/guide/component/layout', 'layout 布局'], '/guide/component/SchemaFormItem' ] } diff --git a/docs/.vuepress/dist/404.html b/docs/.vuepress/dist/404.html new file mode 100644 index 0000000..264204e --- /dev/null +++ b/docs/.vuepress/dist/404.html @@ -0,0 +1,17 @@ + + + + + + Element Schema Form + + + + + + + +

404

That's a Four-Oh-Four.
Take me home.
+ + + diff --git a/docs/.vuepress/dist/assets/css/0.styles.ab8c831f.css b/docs/.vuepress/dist/assets/css/0.styles.ab8c831f.css new file mode 100644 index 0000000..042de4e --- /dev/null +++ b/docs/.vuepress/dist/assets/css/0.styles.ab8c831f.css @@ -0,0 +1 @@ +#nprogress{pointer-events:none}#nprogress .bar{background:#3eaf7c;position:fixed;z-index:1031;top:0;left:0;width:100%;height:2px}#nprogress .peg{display:block;position:absolute;right:0;width:100px;height:100%;box-shadow:0 0 10px #3eaf7c,0 0 5px #3eaf7c;opacity:1;-webkit-transform:rotate(3deg) translateY(-4px);transform:rotate(3deg) translateY(-4px)}#nprogress .spinner{display:block;position:fixed;z-index:1031;top:15px;right:15px}#nprogress .spinner-icon{width:18px;height:18px;box-sizing:border-box;border-color:#3eaf7c transparent transparent #3eaf7c;border-style:solid;border-width:2px;border-radius:50%;-webkit-animation:nprogress-spinner .4s linear infinite;animation:nprogress-spinner .4s linear infinite}.nprogress-custom-parent{overflow:hidden;position:relative}.nprogress-custom-parent #nprogress .bar,.nprogress-custom-parent #nprogress .spinner{position:absolute}@-webkit-keyframes nprogress-spinner{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes nprogress-spinner{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.icon.outbound{color:#aaa;display:inline-block;vertical-align:middle;position:relative;top:-1px}.home{padding:3.6rem 2rem 0;max-width:960px;margin:0 auto;display:block}.home .hero{text-align:center}.home .hero img{max-width:100%;max-height:280px;display:block;margin:3rem auto 1.5rem}.home .hero h1{font-size:3rem}.home .hero .action,.home .hero .description,.home .hero h1{margin:1.8rem auto}.home .hero .description{max-width:35rem;font-size:1.6rem;line-height:1.3;color:#6a8bad}.home .hero .action-button{display:inline-block;font-size:1.2rem;color:#fff;background-color:#3eaf7c;padding:.8rem 1.6rem;border-radius:4px;-webkit-transition:background-color .1s ease;transition:background-color .1s ease;box-sizing:border-box;border-bottom:1px solid #389d70}.home .hero .action-button:hover{background-color:#4abf8a}.home .features{border-top:1px solid #eaecef;padding:1.2rem 0;margin-top:2.5rem;display:-webkit-box;display:flex;flex-wrap:wrap;-webkit-box-align:start;align-items:flex-start;align-content:stretch;-webkit-box-pack:justify;justify-content:space-between}.home .feature{-webkit-box-flex:1;flex-grow:1;flex-basis:30%;max-width:30%}.home .feature h2{font-size:1.4rem;font-weight:500;border-bottom:none;padding-bottom:0;color:#3a5169}.home .feature p{color:#4e6e8e}.home .footer{padding:2.5rem;border-top:1px solid #eaecef;text-align:center;color:#4e6e8e}@media (max-width:719px){.home .features{-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}.home .feature{max-width:100%;padding:0 2.5rem}}@media (max-width:419px){.home{padding-left:1.5rem;padding-right:1.5rem}.home .hero img{max-height:210px;margin:2rem auto 1.2rem}.home .hero h1{font-size:2rem}.home .hero .action,.home .hero .description,.home .hero h1{margin:1.2rem auto}.home .hero .description{font-size:1.2rem}.home .hero .action-button{font-size:1rem;padding:.6rem 1.2rem}.home .feature h2{font-size:1.25rem}}.search-box{display:inline-block;position:relative;margin-right:1rem}.search-box input{cursor:text;width:10rem;height:2rem;color:#4e6e8e;display:inline-block;border:1px solid #cfd4db;border-radius:2rem;font-size:.9rem;line-height:2rem;padding:0 .5rem 0 2rem;outline:none;-webkit-transition:all .2s ease;transition:all .2s ease;background:#fff url(/element-schema-form/assets/img/search.83621669.svg) .6rem .5rem no-repeat;background-size:1rem}.search-box input:focus{cursor:auto;border-color:#3eaf7c}.search-box .suggestions{background:#fff;width:20rem;position:absolute;top:1.5rem;border:1px solid #cfd4db;border-radius:6px;padding:.4rem;list-style-type:none}.search-box .suggestions.align-right{right:0}.search-box .suggestion{line-height:1.4;padding:.4rem .6rem;border-radius:4px;cursor:pointer}.search-box .suggestion a{white-space:normal;color:#5d82a6}.search-box .suggestion a .page-title{font-weight:600}.search-box .suggestion a .header{font-size:.9em;margin-left:.25em}.search-box .suggestion.focused{background-color:#f3f4f5}.search-box .suggestion.focused a{color:#3eaf7c}@media (max-width:959px){.search-box input{cursor:pointer;width:0;border-color:transparent;position:relative}.search-box input:focus{cursor:text;left:0;width:10rem}}@media (-ms-high-contrast:none){.search-box input{height:2rem}}@media (max-width:959px) and (min-width:719px){.search-box .suggestions{left:0}}@media (max-width:719px){.search-box{margin-right:0}.search-box input{left:1rem}.search-box .suggestions{right:0}}@media (max-width:419px){.search-box .suggestions{width:calc(100vw - 4rem)}.search-box input:focus{width:8rem}}.sidebar-button{cursor:pointer;display:none;width:1.25rem;height:1.25rem;position:absolute;padding:.6rem;top:.6rem;left:1rem}.sidebar-button .icon{display:block;width:1.25rem;height:1.25rem}@media (max-width:719px){.sidebar-button{display:block}}.dropdown-enter,.dropdown-leave-to{height:0!important}.dropdown-wrapper{cursor:pointer}.dropdown-wrapper .dropdown-title{display:block;font-size:.9rem;font-family:inherit;cursor:inherit;padding:inherit;line-height:1.4rem;background:transparent;border:none;font-weight:500;color:#2c3e50}.dropdown-wrapper .dropdown-title:hover{border-color:transparent}.dropdown-wrapper .dropdown-title .arrow{vertical-align:middle;margin-top:-1px;margin-left:.4rem}.dropdown-wrapper .nav-dropdown .dropdown-item{color:inherit;line-height:1.7rem}.dropdown-wrapper .nav-dropdown .dropdown-item h4{margin:.45rem 0 0;border-top:1px solid #eee;padding:.45rem 1.5rem 0 1.25rem}.dropdown-wrapper .nav-dropdown .dropdown-item .dropdown-subitem-wrapper{padding:0;list-style:none}.dropdown-wrapper .nav-dropdown .dropdown-item .dropdown-subitem-wrapper .dropdown-subitem{font-size:.9em}.dropdown-wrapper .nav-dropdown .dropdown-item a{display:block;line-height:1.7rem;position:relative;border-bottom:none;font-weight:400;margin-bottom:0;padding:0 1.5rem 0 1.25rem}.dropdown-wrapper .nav-dropdown .dropdown-item a.router-link-active,.dropdown-wrapper .nav-dropdown .dropdown-item a:hover{color:#3eaf7c}.dropdown-wrapper .nav-dropdown .dropdown-item a.router-link-active:after{content:"";width:0;height:0;border-left:5px solid #3eaf7c;border-top:3px solid transparent;border-bottom:3px solid transparent;position:absolute;top:calc(50% - 2px);left:9px}.dropdown-wrapper .nav-dropdown .dropdown-item:first-child h4{margin-top:0;padding-top:0;border-top:0}@media (max-width:719px){.dropdown-wrapper.open .dropdown-title{margin-bottom:.5rem}.dropdown-wrapper .dropdown-title{font-weight:600;font-size:inherit}.dropdown-wrapper .dropdown-title:hover{color:#3eaf7c}.dropdown-wrapper .nav-dropdown{-webkit-transition:height .1s ease-out;transition:height .1s ease-out;overflow:hidden}.dropdown-wrapper .nav-dropdown .dropdown-item h4{border-top:0;margin-top:0;padding-top:0}.dropdown-wrapper .nav-dropdown .dropdown-item>a,.dropdown-wrapper .nav-dropdown .dropdown-item h4{font-size:15px;line-height:2rem}.dropdown-wrapper .nav-dropdown .dropdown-item .dropdown-subitem{font-size:14px;padding-left:1rem}}@media (min-width:719px){.dropdown-wrapper{height:1.8rem}.dropdown-wrapper.open .nav-dropdown,.dropdown-wrapper:hover .nav-dropdown{display:block!important}.dropdown-wrapper.open:blur{display:none}.dropdown-wrapper .dropdown-title .arrow{border-left:4px solid transparent;border-right:4px solid transparent;border-top:6px solid #ccc;border-bottom:0}.dropdown-wrapper .nav-dropdown{display:none;height:auto!important;box-sizing:border-box;max-height:calc(100vh - 2.7rem);overflow-y:auto;position:absolute;top:100%;right:0;background-color:#fff;padding:.6rem 0;border:1px solid;border-color:#ddd #ddd #ccc;text-align:left;border-radius:.25rem;white-space:nowrap;margin:0}}.nav-links{display:inline-block}.nav-links a{line-height:1.4rem;color:inherit}.nav-links a.router-link-active,.nav-links a:hover{color:#3eaf7c}.nav-links .nav-item{position:relative;display:inline-block;margin-left:1.5rem;line-height:2rem}.nav-links .nav-item:first-child{margin-left:0}.nav-links .repo-link{margin-left:1.5rem}@media (max-width:719px){.nav-links .nav-item,.nav-links .repo-link{margin-left:0}}@media (min-width:719px){.nav-links a.router-link-active,.nav-links a:hover{color:#2c3e50}.nav-item>a:not(.external).router-link-active,.nav-item>a:not(.external):hover{margin-bottom:-2px;border-bottom:2px solid #46bd87}}.navbar{padding:.7rem 1.5rem;line-height:2.2rem}.navbar a,.navbar img,.navbar span{display:inline-block}.navbar .logo{height:2.2rem;min-width:2.2rem;margin-right:.8rem;vertical-align:top}.navbar .site-name{font-size:1.3rem;font-weight:600;color:#2c3e50;position:relative}.navbar .links{padding-left:1.5rem;box-sizing:border-box;background-color:#fff;white-space:nowrap;font-size:.9rem;position:absolute;right:1.5rem;top:.7rem;display:-webkit-box;display:flex}.navbar .links .search-box{-webkit-box-flex:0;flex:0 0 auto;vertical-align:top}@media (max-width:719px){.navbar{padding-left:4rem}.navbar .can-hide{display:none}.navbar .links{padding-left:1.5rem}.navbar .site-name{width:calc(100vw - 9.4rem);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}}.page-edit{max-width:740px;margin:0 auto;padding:2rem 2.5rem}@media (max-width:959px){.page-edit{padding:2rem}}@media (max-width:419px){.page-edit{padding:1.5rem}}.page-edit{padding-top:1rem;padding-bottom:1rem;overflow:auto}.page-edit .edit-link{display:inline-block}.page-edit .edit-link a{color:#4e6e8e;margin-right:.25rem}.page-edit .last-updated{float:right;font-size:.9em}.page-edit .last-updated .prefix{font-weight:500;color:#4e6e8e}.page-edit .last-updated .time{font-weight:400;color:#aaa}@media (max-width:719px){.page-edit .edit-link{margin-bottom:.5rem}.page-edit .last-updated{font-size:.8em;float:none;text-align:left}}.page-nav{max-width:740px;margin:0 auto;padding:2rem 2.5rem}@media (max-width:959px){.page-nav{padding:2rem}}@media (max-width:419px){.page-nav{padding:1.5rem}}.page-nav{padding-top:1rem;padding-bottom:0}.page-nav .inner{min-height:2rem;margin-top:0;border-top:1px solid #eaecef;padding-top:1rem;overflow:auto}.page-nav .next{float:right}.page{padding-bottom:2rem;display:block}.sidebar-group .sidebar-group{padding-left:.5em}.sidebar-group:not(.collapsable) .sidebar-heading:not(.clickable){cursor:auto;color:inherit}.sidebar-group.is-sub-group{padding-left:0}.sidebar-group.is-sub-group>.sidebar-heading{font-size:.95em;line-height:1.4;font-weight:400;padding-left:2rem}.sidebar-group.is-sub-group>.sidebar-heading:not(.clickable){opacity:.5}.sidebar-group.is-sub-group>.sidebar-group-items{padding-left:1rem}.sidebar-group.is-sub-group>.sidebar-group-items>li>.sidebar-link{font-size:.95em;border-left:none}.sidebar-group.depth-2>.sidebar-heading{border-left:none}.sidebar-heading{color:#2c3e50;-webkit-transition:color .15s ease;transition:color .15s ease;cursor:pointer;font-size:1.1em;font-weight:700;padding:.35rem 1.5rem .35rem 1.25rem;width:100%;box-sizing:border-box;margin:0;border-left:.25rem solid transparent}.sidebar-heading.open,.sidebar-heading:hover{color:inherit}.sidebar-heading .arrow{position:relative;top:-.12em;left:.5em}.sidebar-heading.clickable.active{font-weight:600;color:#3eaf7c;border-left-color:#3eaf7c}.sidebar-heading.clickable:hover{color:#3eaf7c}.sidebar-group-items{-webkit-transition:height .1s ease-out;transition:height .1s ease-out;font-size:.95em;overflow:hidden}.sidebar .sidebar-sub-headers{padding-left:1rem;font-size:.95em}a.sidebar-link{font-size:1em;font-weight:400;display:inline-block;color:#2c3e50;border-left:.25rem solid transparent;padding:.35rem 1rem .35rem 1.25rem;line-height:1.4;width:100%;box-sizing:border-box}a.sidebar-link:hover{color:#3eaf7c}a.sidebar-link.active{font-weight:600;color:#3eaf7c;border-left-color:#3eaf7c}.sidebar-group a.sidebar-link{padding-left:2rem}.sidebar-sub-headers a.sidebar-link{padding-top:.25rem;padding-bottom:.25rem;border-left:none}.sidebar-sub-headers a.sidebar-link.active{font-weight:500}.sidebar ul{padding:0;margin:0;list-style-type:none}.sidebar a{display:inline-block}.sidebar .nav-links{display:none;border-bottom:1px solid #eaecef;padding:.5rem 0 .75rem}.sidebar .nav-links a{font-weight:600}.sidebar .nav-links .nav-item,.sidebar .nav-links .repo-link{display:block;line-height:1.25rem;font-size:1.1em;padding:.5rem 0 .5rem 1.5rem}.sidebar>.sidebar-links{padding:1.5rem 0}.sidebar>.sidebar-links>li>a.sidebar-link{font-size:1.1em;line-height:1.7;font-weight:700}.sidebar>.sidebar-links>li:not(:first-child){margin-top:.75rem}@media (max-width:719px){.sidebar .nav-links{display:block}.sidebar .nav-links .dropdown-wrapper .nav-dropdown .dropdown-item a.router-link-active:after{top:calc(1rem - 2px)}.sidebar>.sidebar-links{padding:1rem 0}}code[class*=language-],pre[class*=language-]{color:#ccc;background:none;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#2d2d2d}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.block-comment,.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#999}.token.punctuation{color:#ccc}.token.attr-name,.token.deleted,.token.namespace,.token.tag{color:#e2777a}.token.function-name{color:#6196cc}.token.boolean,.token.function,.token.number{color:#f08d49}.token.class-name,.token.constant,.token.property,.token.symbol{color:#f8c555}.token.atrule,.token.builtin,.token.important,.token.keyword,.token.selector{color:#cc99cd}.token.attr-value,.token.char,.token.regex,.token.string,.token.variable{color:#7ec699}.token.entity,.token.operator,.token.url{color:#67cdcc}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.inserted{color:green}.theme-default-content code{color:#476582;padding:.25rem .5rem;margin:0;font-size:.85em;background-color:rgba(27,31,35,.05);border-radius:3px}.theme-default-content code .token.deleted{color:#ec5975}.theme-default-content code .token.inserted{color:#3eaf7c}.theme-default-content pre,.theme-default-content pre[class*=language-]{line-height:1.4;padding:1.25rem 1.5rem;margin:.85rem 0;background-color:#282c34;border-radius:6px;overflow:auto}.theme-default-content pre[class*=language-] code,.theme-default-content pre code{color:#fff;padding:0;background-color:transparent;border-radius:0}div[class*=language-]{position:relative;background-color:#282c34;border-radius:6px}div[class*=language-] .highlight-lines{-webkit-user-select:none;-ms-user-select:none;user-select:none;padding-top:1.3rem;position:absolute;top:0;left:0;width:100%;line-height:1.4}div[class*=language-] .highlight-lines .highlighted{background-color:rgba(0,0,0,.66)}div[class*=language-] pre,div[class*=language-] pre[class*=language-]{background:transparent;position:relative;z-index:1}div[class*=language-]:before{position:absolute;z-index:3;top:.8em;right:1em;font-size:.75rem;color:hsla(0,0%,100%,.4)}div[class*=language-]:not(.line-numbers-mode) .line-numbers-wrapper{display:none}div[class*=language-].line-numbers-mode .highlight-lines .highlighted{position:relative}div[class*=language-].line-numbers-mode .highlight-lines .highlighted:before{content:" ";position:absolute;z-index:3;left:0;top:0;display:block;width:3.5rem;height:100%;background-color:rgba(0,0,0,.66)}div[class*=language-].line-numbers-mode pre{padding-left:4.5rem;vertical-align:middle}div[class*=language-].line-numbers-mode .line-numbers-wrapper{position:absolute;top:0;width:3.5rem;text-align:center;color:hsla(0,0%,100%,.3);padding:1.25rem 0;line-height:1.4}div[class*=language-].line-numbers-mode .line-numbers-wrapper br{-webkit-user-select:none;-ms-user-select:none;user-select:none}div[class*=language-].line-numbers-mode .line-numbers-wrapper .line-number{position:relative;z-index:4;-webkit-user-select:none;-ms-user-select:none;user-select:none;font-size:.85em}div[class*=language-].line-numbers-mode:after{content:"";position:absolute;z-index:2;top:0;left:0;width:3.5rem;height:100%;border-radius:6px 0 0 6px;border-right:1px solid rgba(0,0,0,.66);background-color:#282c34}div[class~=language-js]:before{content:"js"}div[class~=language-ts]:before{content:"ts"}div[class~=language-html]:before{content:"html"}div[class~=language-md]:before{content:"md"}div[class~=language-vue]:before{content:"vue"}div[class~=language-css]:before{content:"css"}div[class~=language-sass]:before{content:"sass"}div[class~=language-scss]:before{content:"scss"}div[class~=language-less]:before{content:"less"}div[class~=language-stylus]:before{content:"stylus"}div[class~=language-go]:before{content:"go"}div[class~=language-java]:before{content:"java"}div[class~=language-c]:before{content:"c"}div[class~=language-sh]:before{content:"sh"}div[class~=language-yaml]:before{content:"yaml"}div[class~=language-py]:before{content:"py"}div[class~=language-docker]:before{content:"docker"}div[class~=language-dockerfile]:before{content:"dockerfile"}div[class~=language-makefile]:before{content:"makefile"}div[class~=language-javascript]:before{content:"js"}div[class~=language-typescript]:before{content:"ts"}div[class~=language-markup]:before{content:"html"}div[class~=language-markdown]:before{content:"md"}div[class~=language-json]:before{content:"json"}div[class~=language-ruby]:before{content:"rb"}div[class~=language-python]:before{content:"py"}div[class~=language-bash]:before{content:"sh"}div[class~=language-php]:before{content:"php"}.custom-block .custom-block-title{font-weight:600;margin-bottom:-.4rem}.custom-block.danger,.custom-block.tip,.custom-block.warning{padding:.1rem 1.5rem;border-left-width:.5rem;border-left-style:solid;margin:1rem 0}.custom-block.tip{background-color:#f3f5f7;border-color:#42b983}.custom-block.warning{background-color:rgba(255,229,100,.3);border-color:#e7c000;color:#6b5900}.custom-block.warning .custom-block-title{color:#b29400}.custom-block.warning a{color:#2c3e50}.custom-block.danger{background-color:#ffe6e6;border-color:#c00;color:#4d0000}.custom-block.danger .custom-block-title{color:#900}.custom-block.danger a{color:#2c3e50}.arrow{display:inline-block;width:0;height:0}.arrow.up{border-bottom:6px solid #ccc}.arrow.down,.arrow.up{border-left:4px solid transparent;border-right:4px solid transparent}.arrow.down{border-top:6px solid #ccc}.arrow.right{border-left:6px solid #ccc}.arrow.left,.arrow.right{border-top:4px solid transparent;border-bottom:4px solid transparent}.arrow.left{border-right:6px solid #ccc}.theme-default-content:not(.custom){max-width:740px;margin:0 auto;padding:2rem 2.5rem}@media (max-width:959px){.theme-default-content:not(.custom){padding:2rem}}@media (max-width:419px){.theme-default-content:not(.custom){padding:1.5rem}}.table-of-contents .badge{vertical-align:middle}body,html{padding:0;margin:0;background-color:#fff}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:16px;color:#2c3e50}.page{padding-left:20rem}.navbar{z-index:20;right:0;height:3.6rem;background-color:#fff;box-sizing:border-box;border-bottom:1px solid #eaecef}.navbar,.sidebar-mask{position:fixed;top:0;left:0}.sidebar-mask{z-index:9;width:100vw;height:100vh;display:none}.sidebar{font-size:16px;background-color:#fff;width:20rem;position:fixed;z-index:10;margin:0;top:3.6rem;left:0;bottom:0;box-sizing:border-box;border-right:1px solid #eaecef;overflow-y:auto}.theme-default-content:not(.custom)>:first-child{margin-top:3.6rem}.theme-default-content:not(.custom) a:hover{text-decoration:underline}.theme-default-content:not(.custom) p.demo{padding:1rem 1.5rem;border:1px solid #ddd;border-radius:4px}.theme-default-content:not(.custom) img{max-width:100%}.theme-default-content.custom{padding:0;margin:0}.theme-default-content.custom img{max-width:100%}a{font-weight:500;text-decoration:none}a,p a code{color:#3eaf7c}p a code{font-weight:400}kbd{background:#eee;border:.15rem solid #ddd;border-bottom:.25rem solid #ddd;border-radius:.15rem;padding:0 .15em}blockquote{font-size:1rem;color:#999;border-left:.2rem solid #dfe2e5;margin:1rem 0;padding:.25rem 0 .25rem 1rem}blockquote>p{margin:0}ol,ul{padding-left:1.2em}strong{font-weight:600}h1,h2,h3,h4,h5,h6{font-weight:600;line-height:1.25}.theme-default-content:not(.custom)>h1,.theme-default-content:not(.custom)>h2,.theme-default-content:not(.custom)>h3,.theme-default-content:not(.custom)>h4,.theme-default-content:not(.custom)>h5,.theme-default-content:not(.custom)>h6{margin-top:-3.1rem;padding-top:4.6rem;margin-bottom:0}.theme-default-content:not(.custom)>h1:first-child,.theme-default-content:not(.custom)>h2:first-child,.theme-default-content:not(.custom)>h3:first-child,.theme-default-content:not(.custom)>h4:first-child,.theme-default-content:not(.custom)>h5:first-child,.theme-default-content:not(.custom)>h6:first-child{margin-top:-1.5rem;margin-bottom:1rem}.theme-default-content:not(.custom)>h1:first-child+.custom-block,.theme-default-content:not(.custom)>h1:first-child+p,.theme-default-content:not(.custom)>h1:first-child+pre,.theme-default-content:not(.custom)>h2:first-child+.custom-block,.theme-default-content:not(.custom)>h2:first-child+p,.theme-default-content:not(.custom)>h2:first-child+pre,.theme-default-content:not(.custom)>h3:first-child+.custom-block,.theme-default-content:not(.custom)>h3:first-child+p,.theme-default-content:not(.custom)>h3:first-child+pre,.theme-default-content:not(.custom)>h4:first-child+.custom-block,.theme-default-content:not(.custom)>h4:first-child+p,.theme-default-content:not(.custom)>h4:first-child+pre,.theme-default-content:not(.custom)>h5:first-child+.custom-block,.theme-default-content:not(.custom)>h5:first-child+p,.theme-default-content:not(.custom)>h5:first-child+pre,.theme-default-content:not(.custom)>h6:first-child+.custom-block,.theme-default-content:not(.custom)>h6:first-child+p,.theme-default-content:not(.custom)>h6:first-child+pre{margin-top:2rem}h1:hover .header-anchor,h2:hover .header-anchor,h3:hover .header-anchor,h4:hover .header-anchor,h5:hover .header-anchor,h6:hover .header-anchor{opacity:1}h1{font-size:2.2rem}h2{font-size:1.65rem;padding-bottom:.3rem;border-bottom:1px solid #eaecef}h3{font-size:1.35rem}a.header-anchor{font-size:.85em;float:left;margin-left:-.87em;padding-right:.23em;margin-top:.125em;opacity:0}a.header-anchor:hover{text-decoration:none}.line-number,code,kbd{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}ol,p,ul{line-height:1.7}hr{border:0;border-top:1px solid #eaecef}table{border-collapse:collapse;margin:1rem 0;display:block;overflow-x:auto}tr{border-top:1px solid #dfe2e5}tr:nth-child(2n){background-color:#f6f8fa}td,th{border:1px solid #dfe2e5;padding:.6em 1em}.theme-container.sidebar-open .sidebar-mask{display:block}.theme-container.no-navbar .theme-default-content:not(.custom)>h1,.theme-container.no-navbar h2,.theme-container.no-navbar h3,.theme-container.no-navbar h4,.theme-container.no-navbar h5,.theme-container.no-navbar h6{margin-top:1.5rem;padding-top:0}.theme-container.no-navbar .sidebar{top:0}@media (min-width:720px){.theme-container.no-sidebar .sidebar{display:none}.theme-container.no-sidebar .page{padding-left:0}}@media (max-width:959px){.sidebar{font-size:15px;width:16.4rem}.page{padding-left:16.4rem}}@media (max-width:719px){.sidebar{top:0;padding-top:3.6rem;transform:translateX(-100%);transition:transform .2s ease}.page{padding-left:0}.theme-container.sidebar-open .sidebar{transform:translateX(0)}.theme-container.no-navbar .sidebar{padding-top:0}}@media (max-width:419px){h1{font-size:1.9rem}.theme-default-content div[class*=language-]{margin:.85rem -1.5rem;border-radius:0}}table thead th{color:#909399;font-size:14px}table tbody td{color:#606266;font-size:14px}.badge[data-v-172fd448]{display:inline-block;font-size:14px;height:18px;line-height:18px;border-radius:3px;padding:0 6px;color:#fff}.badge.green[data-v-172fd448],.badge.tip[data-v-172fd448],.badge[data-v-172fd448]{background-color:#42b983}.badge.error[data-v-172fd448]{background-color:#da5961}.badge.warn[data-v-172fd448],.badge.warning[data-v-172fd448],.badge.yellow[data-v-172fd448]{background-color:#e7c000}.badge+.badge[data-v-172fd448]{margin-left:5px} \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/img/search.83621669.svg b/docs/.vuepress/dist/assets/img/search.83621669.svg new file mode 100644 index 0000000..03d8391 --- /dev/null +++ b/docs/.vuepress/dist/assets/img/search.83621669.svg @@ -0,0 +1 @@ + diff --git a/docs/.vuepress/dist/assets/js/10.de302617.js b/docs/.vuepress/dist/assets/js/10.de302617.js new file mode 100644 index 0000000..30f8056 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/10.de302617.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[10],{191:function(t,e,l){"use strict";l.r(e);var a=l(0),i=Object(a.a)({},function(){var t=this,e=t.$createElement,l=t._self._c||e;return l("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[l("h3",{attrs:{id:"简介"}},[l("a",{staticClass:"header-anchor",attrs:{href:"#简介","aria-hidden":"true"}},[t._v("#")]),t._v(" 简介")]),t._v(" "),l("p",[t._v("SchemaForm 整体布局采用 el-row 和 el-col 进行分装, 通过基础的24分栏,迅速简便地创建布局")]),t._v(" "),l("p",[l("strong",[t._v("layout Attributes")])]),t._v(" "),l("table",[l("thead",[l("tr",[l("th",{staticStyle:{"text-align":"left"}},[t._v("参数")]),t._v(" "),l("th",{staticStyle:{"text-align":"left"}},[t._v("说明")]),t._v(" "),l("th",{staticStyle:{"text-align":"left"}},[t._v("类型")]),t._v(" "),l("th",{staticStyle:{"text-align":"left"}},[t._v("可选值")]),t._v(" "),l("th",{staticStyle:{"text-align":"left"}},[t._v("默认值")])])]),t._v(" "),l("tbody",[l("tr",[l("td",{staticStyle:{"text-align":"left"}},[t._v("gutter")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("栅格间隔")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("number")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("—")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("0")])]),t._v(" "),l("tr",[l("td",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("布局模式,可选 flex,现代浏览器下有效")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("—")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("—")])]),t._v(" "),l("tr",[l("td",{staticStyle:{"text-align":"left"}},[t._v("justify")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("flex布局下的水平排列方式")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("start/end/center/space-around/space-between")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("start")])]),t._v(" "),l("tr",[l("td",{staticStyle:{"text-align":"left"}},[t._v("align")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("flex布局下的垂直排列方式")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("top/middle/bottom")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("top")])]),t._v(" "),l("tr",[l("td",{staticStyle:{"text-align":"left"}},[t._v("tag")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("自定义元素标签")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("*")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("div")])])])]),t._v(" "),l("p",[l("strong",[t._v("colGrid Attributes")])]),t._v(" "),l("table",[l("thead",[l("tr",[l("th",{staticStyle:{"text-align":"left"}},[t._v("参数")]),t._v(" "),l("th",{staticStyle:{"text-align":"left"}},[t._v("说明")]),t._v(" "),l("th",{staticStyle:{"text-align":"left"}},[t._v("类型")]),t._v(" "),l("th",{staticStyle:{"text-align":"left"}},[t._v("可选值")]),t._v(" "),l("th",{staticStyle:{"text-align":"left"}},[t._v("默认值")])])]),t._v(" "),l("tbody",[l("tr",[l("td",{staticStyle:{"text-align":"left"}},[t._v("span")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("栅格占据的列数")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("number")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("—")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("24")])]),t._v(" "),l("tr",[l("td",{staticStyle:{"text-align":"left"}},[t._v("offset")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("栅格左侧的间隔格数")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("number")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("—")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("0")])]),t._v(" "),l("tr",[l("td",{staticStyle:{"text-align":"left"}},[t._v("push")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("栅格向右移动格数")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("number")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("—")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("0")])]),t._v(" "),l("tr",[l("td",{staticStyle:{"text-align":"left"}},[t._v("pull")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("栅格向左移动格数")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("number")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("—")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("0")])]),t._v(" "),l("tr",[l("td",{staticStyle:{"text-align":"left"}},[t._v("xs")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("<768px")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("响应式栅格数或者栅格属性对象")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("number/object (例如: {span: 4, offset: 4})")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("—")])]),t._v(" "),l("tr",[l("td",{staticStyle:{"text-align":"left"}},[t._v("sm")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("≥768px")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("响应式栅格数或者栅格属性对象")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("number/object (例如: {span: 4, offset: 4})")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("—")])]),t._v(" "),l("tr",[l("td",{staticStyle:{"text-align":"left"}},[t._v("md")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("≥992px")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("响应式栅格数或者栅格属性对象")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("number/object (例如: {span: 4, offset: 4})")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("—")])]),t._v(" "),l("tr",[l("td",{staticStyle:{"text-align":"left"}},[t._v("lg")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("≥1200px")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("响应式栅格数或者栅格属性对象")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("number/object (例如: {span: 4, offset: 4})")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("—")])]),t._v(" "),l("tr",[l("td",{staticStyle:{"text-align":"left"}},[t._v("xl")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("≥1920px")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("响应式栅格数或者栅格属性对象")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("number/object (例如: {span: 4, offset: 4})")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("—")])]),t._v(" "),l("tr",[l("td",{staticStyle:{"text-align":"left"}},[t._v("tag")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("自定义元素标签")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}},[t._v("string\t*\tdiv")]),t._v(" "),l("td",{staticStyle:{"text-align":"left"}}),t._v(" "),l("td",{staticStyle:{"text-align":"left"}})])])])])},[],!1,null,null,null);e.default=i.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/11.dcfa8730.js b/docs/.vuepress/dist/assets/js/11.dcfa8730.js new file mode 100644 index 0000000..4c587e2 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/11.dcfa8730.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[11],{196:function(t,e,a){"use strict";a.r(e);var s=a(0),n=Object(s.a)({},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h2",{attrs:{id:"数据字段-prop"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#数据字段-prop","aria-hidden":"true"}},[t._v("#")]),t._v(" 数据字段 prop")]),t._v(" "),a("h5",{attrs:{id:"prop-是辨别当前组件的唯一字段,既是-model-和-options-的键值-key,又是el-form-使用-validate、resetfields-方法的必填字段,所以需保证-prop的-唯一性"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#prop-是辨别当前组件的唯一字段,既是-model-和-options-的键值-key,又是el-form-使用-validate、resetfields-方法的必填字段,所以需保证-prop的-唯一性","aria-hidden":"true"}},[t._v("#")]),t._v(" prop 是辨别当前组件的唯一字段,既是 "),a("code",[t._v("model 和 options 的键值 key")]),t._v(",又是"),a("code",[t._v("el-form")]),t._v(" 使用 "),a("code",[t._v("validate、resetFields")]),t._v(" 方法的必填字段,所以需保证 prop的 唯一性")]),t._v(" "),a("h2",{attrs:{id:"组件类型-type"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#组件类型-type","aria-hidden":"true"}},[t._v("#")]),t._v(" 组件类型 type")]),t._v(" "),a("h5",{attrs:{id:"schemaform-的组件是基于-element-进行分装,目标是完美兼容原组件的所有属性"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#schemaform-的组件是基于-element-进行分装,目标是完美兼容原组件的所有属性","aria-hidden":"true"}},[t._v("#")]),t._v(" SchemaForm 的组件是基于 Element 进行分装,目标是完美兼容原组件的所有属性")]),t._v(" "),a("h4",{attrs:{id:"内置类型"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#内置类型","aria-hidden":"true"}},[t._v("#")]),t._v(" 内置类型")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"left"}},[t._v("类型")]),t._v(" "),a("th",{staticStyle:{"text-align":"left"}},[t._v("含义")]),t._v(" "),a("th",{staticStyle:{"text-align":"left"}},[t._v("属性参考")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("input")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("输入框")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[a("a",{attrs:{href:"https://element.eleme.cn/#/zh-CN/component/input",target:"_blank",rel:"noopener noreferrer"}},[t._v("el-input"),a("OutboundLink")],1)])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("select")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("选择器")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[a("a",{attrs:{href:"https://element.eleme.cn/#/zh-CN/component/select",target:"_blank",rel:"noopener noreferrer"}},[t._v("el-select"),a("OutboundLink")],1)])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("radio")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("单选框组")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[a("a",{attrs:{href:"https://element.eleme.cn/#/zh-CN/component/radio",target:"_blank",rel:"noopener noreferrer"}},[t._v("el-radio-group"),a("OutboundLink")],1)])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("checkbox")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("多选框组")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[a("a",{attrs:{href:"https://element.eleme.cn/#/zh-CN/component/checkbox",target:"_blank",rel:"noopener noreferrer"}},[t._v("el-checkbox-group"),a("OutboundLink")],1)])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("cascader")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("级联选择器")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[a("a",{attrs:{href:"https://element.eleme.cn/#/zh-CN/component/cascader",target:"_blank",rel:"noopener noreferrer"}},[t._v("el-cascader"),a("OutboundLink")],1)])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("switch")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("开关")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[a("a",{attrs:{href:"https://element.eleme.cn/#/zh-CN/component/switch",target:"_blank",rel:"noopener noreferrer"}},[t._v("el-switch"),a("OutboundLink")],1)])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("slider")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("滑块")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[a("a",{attrs:{href:"https://element.eleme.cn/#/zh-CN/component/slider",target:"_blank",rel:"noopener noreferrer"}},[t._v("el-slider"),a("OutboundLink")],1)])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("datepicker")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("日期选择器")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[a("a",{attrs:{href:"https://element.eleme.cn/#/zh-CN/component/date-picker",target:"_blank",rel:"noopener noreferrer"}},[t._v("el-date-picker"),a("OutboundLink")],1)])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("timeselect")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("时间选择器")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[a("a",{attrs:{href:"https://element.eleme.cn/#/zh-CN/component/time-picker",target:"_blank",rel:"noopener noreferrer"}},[t._v("el-time-select"),a("OutboundLink")],1)])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("colorpicker")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("颜色选择器")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[a("a",{attrs:{href:"https://element.eleme.cn/#/zh-CN/component/color-picker",target:"_blank",rel:"noopener noreferrer"}},[t._v("el-color-picker"),a("OutboundLink")],1)])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("progress")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("进度条")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[a("a",{attrs:{href:"https://element.eleme.cn/#/zh-CN/component/progress",target:"_blank",rel:"noopener noreferrer"}},[t._v("el-progress"),a("OutboundLink")],1)])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("rate")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("评分")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[a("a",{attrs:{href:"https://element.eleme.cn/#/zh-CN/component/rate",target:"_blank",rel:"noopener noreferrer"}},[t._v("el-rate"),a("OutboundLink")],1)])])])]),t._v(" "),a("h2",{attrs:{id:"表单属性-formitem"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#表单属性-formitem","aria-hidden":"true"}},[t._v("#")]),t._v(" 表单属性 formItem")]),t._v(" "),a("h5",{attrs:{id:"兼容所有el-form-item的属性-以下内容为常用属性"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#兼容所有el-form-item的属性-以下内容为常用属性","aria-hidden":"true"}},[t._v("#")]),t._v(" 兼容所有el-form-item的属性,以下内容为常用属性")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"left"}},[t._v("参数")]),t._v(" "),a("th",{staticStyle:{"text-align":"left"}},[t._v("说明")]),t._v(" "),a("th",{staticStyle:{"text-align":"left"}},[t._v("类型")]),t._v(" "),a("th",{staticStyle:{"text-align":"left"}},[t._v("可选值")]),t._v(" "),a("th",{staticStyle:{"text-align":"left"}},[t._v("默认值")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("label")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("标签文本")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("—")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("—")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("label-width")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("表单域标签的的宽度,例如 '50px'。支持 auto")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("—")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("—")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("show-message")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("是否显示校验错误信息")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("boolean")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("—")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("true")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("inline-message")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("以行内形式展示校验信息")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("boolean")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("—")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("false")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("size")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("用于控制该表单域下组件的尺寸")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("medium / small / mini")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("-")])])])]),t._v(" "),a("h2",{attrs:{id:"绑定值修饰符-modifier"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#绑定值修饰符-modifier","aria-hidden":"true"}},[t._v("#")]),t._v(" 绑定值修饰符 modifier")]),t._v(" "),a("h5",{attrs:{id:"为了更好的支持数值绑定,增加了v-model的修饰符,现支持"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#为了更好的支持数值绑定,增加了v-model的修饰符,现支持","aria-hidden":"true"}},[t._v("#")]),t._v(" 为了更好的支持数值绑定,增加了"),a("code",[t._v("v-model")]),t._v("的修饰符,现支持")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"left"}},[t._v("参数")]),t._v(" "),a("th",{staticStyle:{"text-align":"left"}},[t._v("说明")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("number")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("自动将用户的输入值转为数值类型")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("trim")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("自动过滤用户输入的首尾空白字符")])])])]),t._v(" "),a("h2",{attrs:{id:"属性绑定-attrs"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#属性绑定-attrs","aria-hidden":"true"}},[t._v("#")]),t._v(" 属性绑定 attrs")]),t._v(" "),a("h5",{attrs:{id:"支持element组件的属性,以el-input为例-具体参数-可参考-element"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#支持element组件的属性,以el-input为例-具体参数-可参考-element","aria-hidden":"true"}},[t._v("#")]),t._v(" 支持Element组件的属性,以"),a("code",[t._v("el-input")]),t._v("为例,具体参数 可参考 "),a("a",{attrs:{href:"https://element.eleme.cn/#/zh-CN",target:"_blank",rel:"noopener noreferrer"}},[t._v("Element"),a("OutboundLink")],1)]),t._v(" "),a("div",{staticClass:"language-js extra-class"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n type"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'input'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n prop"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'name'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n attrs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" type"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'textarea'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h2",{attrs:{id:"动态属性绑定-dynamicattrs"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#动态属性绑定-dynamicattrs","aria-hidden":"true"}},[t._v("#")]),t._v(" 动态属性绑定 dynamicAttrs")]),t._v(" "),a("h5",{attrs:{id:"除了绑定的静态属性外,还支持动态属性的绑定,例如用于与其它操作联动"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#除了绑定的静态属性外,还支持动态属性的绑定,例如用于与其它操作联动","aria-hidden":"true"}},[t._v("#")]),t._v(" 除了绑定的静态属性外,还支持动态属性的绑定,例如用于与其它操作联动")]),t._v(" "),a("div",{staticClass:"language-js extra-class"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n type"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'input'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n prop"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'name'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n dynamicAttrs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" disabled"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("model"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("id "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h2",{attrs:{id:"事件绑定-on"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#事件绑定-on","aria-hidden":"true"}},[t._v("#")]),t._v(" 事件绑定 on")]),t._v(" "),a("h5",{attrs:{id:"支持element组件的事件,以el-input为例-具体参数-可参考-element"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#支持element组件的事件,以el-input为例-具体参数-可参考-element","aria-hidden":"true"}},[t._v("#")]),t._v(" 支持Element组件的事件,以"),a("code",[t._v("el-input")]),t._v("为例,具体参数 可参考 "),a("a",{attrs:{href:"https://element.eleme.cn/#/zh-CN",target:"_blank",rel:"noopener noreferrer"}},[t._v("Element"),a("OutboundLink")],1)]),t._v(" "),a("div",{staticClass:"language-js extra-class"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n type"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'input'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n prop"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'name'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n on"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" focus"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("onNameFocus "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h4",{attrs:{id:"事件-按键修饰符"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#事件-按键修饰符","aria-hidden":"true"}},[t._v("#")]),t._v(" 事件 & 按键修饰符")]),t._v(" "),a("h5",{attrs:{id:"对于-passive、-capture-和-once-这些事件修饰符-vue-提供了相应的前缀可以用于-on"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#对于-passive、-capture-和-once-这些事件修饰符-vue-提供了相应的前缀可以用于-on","aria-hidden":"true"}},[t._v("#")]),t._v(" 对于 .passive、.capture 和 .once 这些事件修饰符, Vue 提供了相应的前缀可以用于 on")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"left"}},[t._v("修饰符")]),t._v(" "),a("th",{staticStyle:{"text-align":"left"}},[t._v("前缀")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v(".passive")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("&")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v(".capture")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("!")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v(".once")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("~")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v(".capture.once 或 .once.capture")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("~!")])])])]),t._v(" "),a("div",{staticClass:"language-js extra-class"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[t._v("on"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'!click'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("doThisInCapturingMode"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'~keyup'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("doThisOnce"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'~!mouseover'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("doThisOnceInCapturingMode\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h5",{attrs:{id:"对于所有其它的修饰符,私有前缀都不是必须的,因为你可以在事件处理函数中使用事件方法:"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#对于所有其它的修饰符,私有前缀都不是必须的,因为你可以在事件处理函数中使用事件方法:","aria-hidden":"true"}},[t._v("#")]),t._v(" 对于所有其它的修饰符,私有前缀都不是必须的,因为你可以在事件处理函数中使用事件方法:")]),t._v(" "),a("div",{staticClass:"language-js extra-class"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[t._v("on"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n keyup"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("event"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// .self 等价于 如果触发事件的元素不是事件绑定的元素则返回")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("event"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("target "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!==")]),t._v(" event"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("currentTarget"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 如果按下去的不是 enter 键或者")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 没有同时按下 shift 键")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 则返回")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("event"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("shiftKey "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("||")]),t._v(" event"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("keyCode "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!==")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("13")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 阻止 事件冒泡")]),t._v("\n event"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("stopPropagation")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 阻止该元素默认的 keyup 事件")]),t._v("\n event"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("preventDefault")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h2",{attrs:{id:"插槽-slot"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#插槽-slot","aria-hidden":"true"}},[t._v("#")]),t._v(" 插槽 slot")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"left"}},[t._v("参数")]),t._v(" "),a("th",{staticStyle:{"text-align":"left"}},[t._v("说明")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("slot")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("自定义完整组件")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("frontSlot")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("定义element 组件前的插槽")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("compSlot")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("定义element 组件内的插槽")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("rearSlot")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("定义element 组件后的插槽")])])])])])},[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/12.73e38090.js b/docs/.vuepress/dist/assets/js/12.73e38090.js new file mode 100644 index 0000000..2295db5 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/12.73e38090.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{199:function(t,e,n){"use strict";n.r(e);var s=n(0),l=Object(s.a)({},function(){var t=this.$createElement;return(this._self._c||t)("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}})},[],!1,null,null,null);e.default=l.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/13.26ace040.js b/docs/.vuepress/dist/assets/js/13.26ace040.js new file mode 100644 index 0000000..ceadbc0 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/13.26ace040.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{197:function(t,a,s){"use strict";s.r(a);var n=s(0),e=Object(n.a)({},function(){var t=this,a=t.$createElement,s=t._self._c||a;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h2",{attrs:{id:"安装"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#安装","aria-hidden":"true"}},[t._v("#")]),t._v(" 安装")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("npm")]),t._v(" i vue-schema-form -S\n")])])]),s("p",[t._v("or")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[t._v("yarn add vue-schema-form\n")])])]),s("h2",{attrs:{id:"引入组件"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#引入组件","aria-hidden":"true"}},[t._v("#")]),t._v(" 引入组件")]),t._v(" "),s("p",[t._v("完整引入")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" SchemaForm "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'vue-schema-form'")]),t._v("\n\nVue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("use")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("SchemaForm"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("h2",{attrs:{id:"引入第三方扩展"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#引入第三方扩展","aria-hidden":"true"}},[t._v("#")]),t._v(" 引入第三方扩展")]),t._v(" "),s("p",[s("code",[t._v("SchemaForm")]),t._v(" 支持一些用于表单渲染的高级组件,例如富文本编辑器、代码编辑器、JSON编辑器、Markdown编辑器等")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[t._v("Vue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("component")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'SchemaFormJsoneditor'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" SchemaFormJsoneditor"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nVue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("component")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'SchemaFormQuill'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" SchemaFormQuill"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nVue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("component")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'SchemaFormCodemirror'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" SchemaFormCodemirror"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("h2",{attrs:{id:"组件预设配置"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#组件预设配置","aria-hidden":"true"}},[t._v("#")]),t._v(" 组件预设配置")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// input 框 placeholder 预设")]),t._v("\nVue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("use")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("SchemaForm"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n placeholder"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'全局定义变量实验'")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// codemirror 插件配置项预设")]),t._v("\nVue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("use")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("SchemaForm"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'codemirror'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n cmOptions"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n tabSize"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n mode"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'text/javascript'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n theme"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'cobalt'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n lineNumbers"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n line"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])])])},[],!1,null,null,null);a.default=e.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/14.70636053.js b/docs/.vuepress/dist/assets/js/14.70636053.js new file mode 100644 index 0000000..452a59a --- /dev/null +++ b/docs/.vuepress/dist/assets/js/14.70636053.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[14],{195:function(t,e,n){"use strict";n.r(e);var s=n(0),l=Object(s.a)({},function(){var t=this.$createElement;return(this._self._c||t)("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}})},[],!1,null,null,null);e.default=l.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/15.e08f9886.js b/docs/.vuepress/dist/assets/js/15.e08f9886.js new file mode 100644 index 0000000..60ca34c --- /dev/null +++ b/docs/.vuepress/dist/assets/js/15.e08f9886.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[15],{9:function(n,w,o){}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/2.e5e9c439.js b/docs/.vuepress/dist/assets/js/2.e5e9c439.js new file mode 100644 index 0000000..2aba421 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/2.e5e9c439.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[2],[,,,,,,,,,,function(t,e,n){var r=n(67)("wks"),i=n(34),o=n(11).Symbol,s="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=s&&o[t]||(s?o:i)("Symbol."+t))}).store=r},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){var r=n(87)("wks"),i=n(88),o=n(20).Symbol,s="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=s&&o[t]||(s?o:i)("Symbol."+t))}).store=r},function(t,e,n){"use strict";n.d(e,"d",function(){return r}),n.d(e,"a",function(){return o}),n.d(e,"i",function(){return s}),n.d(e,"f",function(){return u}),n.d(e,"g",function(){return c}),n.d(e,"h",function(){return l}),n.d(e,"b",function(){return f}),n.d(e,"e",function(){return p}),n.d(e,"k",function(){return h}),n.d(e,"l",function(){return d}),n.d(e,"c",function(){return v}),n.d(e,"j",function(){return g});const r=/#.*$/,i=/\.(md|html)$/,o=/\/$/,s=/^[a-z]+:/i;function a(t){return decodeURI(t).replace(r,"").replace(i,"")}function u(t){return s.test(t)}function c(t){return/^mailto:/.test(t)}function l(t){return/^tel:/.test(t)}function f(t){if(u(t))return t;const e=t.match(r),n=e?e[0]:"",i=a(t);return o.test(i)?t:i+".html"+n}function p(t,e){const n=t.hash,i=function(t){const e=t.match(r);if(e)return e[0]}(e);return(!i||n===i)&&a(t.path)===a(e)}function h(t,e,n){if(u(e))return{type:"external",path:e};n&&(e=function(t,e,n){const r=t.charAt(0);if("/"===r)return t;if("?"===r||"#"===r)return e+t;const i=e.split("/");n&&i[i.length-1]||i.pop();const o=t.replace(/^\//,"").split("/");for(let t=0;t({type:"auto",title:e.title,basePath:t.path,path:t.path+"#"+e.slug,children:e.children||[]}))}]}(t);const a=s.sidebar||o.sidebar;if(a){const{base:t,config:n}=function(t,e){if(Array.isArray(e))return{base:"/",config:e};for(const n in e)if(0===m(t).indexOf(encodeURI(n)))return{base:n,config:e[n]};return{}}(e,a);return n?n.map(e=>(function t(e,n,r,i=1){if("string"==typeof e)return h(n,e,r);if(Array.isArray(e))return Object.assign(h(n,e[0],r),{title:e[1]});{i>3&&console.error("[vuepress] detected a too deep nested sidebar group.");const o=e.children||[];return 0===o.length&&e.path?Object.assign(h(n,e.path,r),{title:e.title}):{type:"group",path:e.path,title:e.title,sidebarDepth:e.sidebarDepth,children:o.map(e=>t(e,n,r,i+1)),collapsable:!1!==e.collapsable}}})(e,i,t)):[]}return[]}function v(t){let e;return(t=t.map(t=>Object.assign({},t))).forEach(t=>{2===t.level?e=t:e&&(e.children||(e.children=[])).push(t)}),t.filter(t=>2===t.level)}function g(t){return Object.assign(t,{type:t.items&&t.items.length?"links":"link"})}function m(t){return/(\.html|\/)$/.test(t)?t:t+"/"}},function(t,e,n){var r=n(22),i=n(35);t.exports=n(16)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){t.exports=!n(17)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){var r=n(11),i=n(38),o=n(14),s=n(25),a=n(39),u=function(t,e,n){var c,l,f,p,h=t&u.F,d=t&u.G,v=t&u.S,g=t&u.P,m=t&u.B,b=d?r:v?r[e]||(r[e]={}):(r[e]||{}).prototype,y=d?i:i[e]||(i[e]={}),x=y.prototype||(y.prototype={});for(c in d&&(n=e),n)f=((l=!h&&b&&void 0!==b[c])?b:n)[c],p=m&&l?a(f,r):g&&"function"==typeof f?a(Function.call,f):f,b&&s(b,c,f,t&u.U),y[c]!=f&&o(y,c,p),g&&x[c]!=f&&(x[c]=f)};r.core=i,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){t.exports={}},function(t,e,n){var r=n(23),i=n(68),o=n(70),s=Object.defineProperty;e.f=n(16)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var r=n(15);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){var r=n(11),i=n(14),o=n(19),s=n(34)("src"),a=Function.toString,u=(""+a).split("toString");n(38).inspectSource=function(t){return a.call(t)},(t.exports=function(t,e,n,a){var c="function"==typeof n;c&&(o(n,"name")||i(n,"name",e)),t[e]!==n&&(c&&(o(n,s)||i(n,s,t[e]?""+t[e]:u.join(String(e)))),t===r?t[e]=n:a?t[e]?t[e]=n:i(t,e,n):(delete t[e],i(t,e,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[s]||a.call(this)})},function(t,e){var n=t.exports={version:"2.5.3"};"number"==typeof __e&&(__e=n)},function(t,e,n){var r=n(29),i=n(49);t.exports=n(31)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(71),i=n(24);t.exports=function(t){return r(i(t))}},function(t,e,n){var r=n(30),i=n(131),o=n(132),s=Object.defineProperty;e.f=n(31)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var r=n(48);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){t.exports=!n(82)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(10)("unscopables"),i=Array.prototype;null==i[r]&&n(14)(i,r,{}),t.exports=function(t){i[r][t]=!0}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){t.exports={}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e){var n=t.exports={version:"2.5.3"};"number"==typeof __e&&(__e=n)},function(t,e,n){var r=n(102);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){var r=n(72),i=n(42);t.exports=Object.keys||function(t){return r(t,i)}},function(t,e,n){var r=n(67)("keys"),i=n(34);t.exports=function(t){return r[t]||(r[t]=i(t))}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var r=n(24);t.exports=function(t){return Object(r(t))}},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){var r=n(20),i=n(26),o=n(81),s=n(27),a=function(t,e,n){var u,c,l,f=t&a.F,p=t&a.G,h=t&a.S,d=t&a.P,v=t&a.B,g=t&a.W,m=p?i:i[e]||(i[e]={}),b=m.prototype,y=p?r:h?r[e]:(r[e]||{}).prototype;for(u in p&&(n=e),n)(c=!f&&y&&void 0!==y[u])&&u in m||(l=c?y[u]:n[u],m[u]=p&&"function"!=typeof y[u]?n[u]:v&&c?o(l,r):g&&y[u]==l?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(l):d&&"function"==typeof l?o(Function.call,l):l,d&&((m.virtual||(m.virtual={}))[u]=l,t&a.R&&b&&!b[u]&&s(b,u,l)))};a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,t.exports=a},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){var r=n(144),i=n(52);t.exports=function(t){return r(i(t))}},function(t,e,n){var r=n(87)("keys"),i=n(88);t.exports=function(t){return r[t]||(r[t]=i(t))}},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},,function(t,e,n){for(var r=n(98),i=n(40),o=n(25),s=n(11),a=n(14),u=n(36),c=n(10),l=c("iterator"),f=c("toStringTag"),p=u.Array,h={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},d=i(h),v=0;vu;)r(a,n=e[u++])&&(~o(c,n)||c.push(n));return c}},function(t,e,n){var r=n(28),i=n(74),o=n(106);t.exports=function(t){return function(e,n,s){var a,u=r(e),c=i(u.length),l=o(s,c);if(t&&n!=n){for(;c>l;)if((a=u[l++])!=a)return!0}else for(;c>l;l++)if((t||l in u)&&u[l]===n)return t||l||0;return!t&&-1}}},function(t,e,n){var r=n(75),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(22).f,i=n(19),o=n(10)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},function(t,e,n){var r=n(43),i=n(40);n(109)("keys",function(){return function(t){return i(r(t))}})},function(t,e,n){var r=n(15),i=n(37),o=n(10)("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[o])?!!e:"RegExp"==i(t))}},function(t,e,n){n(80)("match",1,function(t,e,n){return[function(n){"use strict";var r=t(this),i=null==n?void 0:n[e];return void 0!==i?i.call(n,r):new RegExp(n)[e](String(r))},n]})},function(t,e,n){"use strict";var r=n(14),i=n(25),o=n(17),s=n(24),a=n(10);t.exports=function(t,e,n){var u=a(t),c=n(s,u,""[t]),l=c[0],f=c[1];o(function(){var e={};return e[u]=function(){return 7},7!=""[t](e)})&&(i(String.prototype,t,l),r(RegExp.prototype,u,2==e?function(t,e){return f.call(t,this,e)}:function(t){return f.call(t,this)}))}},function(t,e,n){var r=n(130);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){var r=n(48),i=n(20).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,e,n){"use strict";var r=n(136)(!0);n(85)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){"use strict";var r=n(137),i=n(47),o=n(138),s=n(27),a=n(32),u=n(21),c=n(139),l=n(90),f=n(148),p=n(12)("iterator"),h=!([].keys&&"next"in[].keys()),d=function(){return this};t.exports=function(t,e,n,v,g,m,b){c(n,e,v);var y,x,_,k=function(t){if(!h&&t in w)return w[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},S=e+" Iterator",L="values"==g,O=!1,w=t.prototype,C=w[p]||w["@@iterator"]||g&&w[g],j=!h&&C||k(g),$=g?L?k("entries"):j:void 0,T="Array"==e&&w.entries||C;if(T&&(_=f(T.call(new t)))!==Object.prototype&&_.next&&(l(_,S,!0),r||a(_,p)||s(_,p,d)),L&&C&&"values"!==C.name&&(O=!0,j=function(){return C.call(this)}),r&&!b||!h&&!O&&w[p]||s(w,p,j),u[e]=j,u[S]=d,g)if(y={values:L?j:k("values"),keys:m?j:k("keys"),entries:$},b)for(x in y)x in w||o(w,x,y[x]);else i(i.P+i.F*(h||O),e,y);return y}},function(t,e,n){var r=n(51),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,e,n){var r=n(20),i=r["__core-js_shared__"]||(r["__core-js_shared__"]={});t.exports=function(t){return i[t]||(i[t]={})}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var r=n(29).f,i=n(32),o=n(12)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},function(t,e,n){var r=n(52);t.exports=function(t){return Object(r(t))}},function(t,e,n){var r=n(50),i=n(12)("toStringTag"),o="Arguments"==r(function(){return arguments}());t.exports=function(t){var e,n,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),i))?n:o?r(e):"Object"==(s=r(e))&&"function"==typeof e.callee?"Arguments":s}},function(t,e,n){n(80)("replace",2,function(t,e,n){return[function(r,i){"use strict";var o=t(this),s=null==r?void 0:r[e];return void 0!==s?s.call(r,o,i):n.call(String(o),r,i)},n]})},function(t,e){t.exports=function(t){return null==t}},function(t,e,n){var r=n(170).Symbol;t.exports=r},function(t,e,n){"use strict";n.r(e);var r=n(13),i={name:"SidebarGroup",props:["item","open","collapsable","depth"],components:{DropdownTransition:n(97).a},beforeCreate:function(){this.$options.components.SidebarLinks=n(96).default},methods:{isActive:r.e}},o=(n(178),n(0)),s=Object(o.a)(i,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("section",{staticClass:"sidebar-group",class:[{collapsable:t.collapsable,"is-sub-group":0!==t.depth},"depth-"+t.depth]},[t.item.path?n("router-link",{staticClass:"sidebar-heading clickable",class:{open:t.open,active:t.isActive(t.$route,t.item.path)},attrs:{to:t.item.path},nativeOn:{click:function(e){return t.$emit("toggle")}}},[n("span",[t._v(t._s(t.item.title))]),t._v(" "),t.collapsable?n("span",{staticClass:"arrow",class:t.open?"down":"right"}):t._e()]):n("p",{staticClass:"sidebar-heading",class:{open:t.open},on:{click:function(e){return t.$emit("toggle")}}},[n("span",[t._v(t._s(t.item.title))]),t._v(" "),t.collapsable?n("span",{staticClass:"arrow",class:t.open?"down":"right"}):t._e()]),t._v(" "),n("DropdownTransition",[t.open||!t.collapsable?n("SidebarLinks",{staticClass:"sidebar-group-items",attrs:{items:t.item.children,sidebarDepth:t.item.sidebarDepth,depth:t.depth+1}}):t._e()],1)],1)},[],!1,null,null,null).exports;n(179);function a(t,e,n,r){return t("router-link",{props:{to:e,activeClass:"",exactActiveClass:""},class:{active:r,"sidebar-link":!0}},n)}function u(t,e,n,i,o){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;return!e||s>o?null:t("ul",{class:"sidebar-sub-headers"},e.map(function(e){var c=Object(r.e)(i,n+"#"+e.slug);return t("li",{class:"sidebar-sub-header"},[a(t,n+"#"+e.slug,e.title,c),u(t,e.children,n,i,o,s+1)])}))}var c={functional:!0,props:["item","sidebarDepth"],render:function(t,e){var n=e.parent,i=n.$page,o=(n.$site,n.$route),s=n.$themeConfig,c=n.$themeLocaleConfig,l=e.props,f=l.item,p=l.sidebarDepth,h=Object(r.e)(o,f.path),d="auto"===f.type?h||f.children.some(function(t){return Object(r.e)(o,f.basePath+"#"+t.slug)}):h,v="external"===f.type?function(t,e,n){return t("a",{attrs:{href:e,target:"_blank",rel:"noopener noreferrer"},class:{"sidebar-link":!0}},[n,t("OutboundLink")])}(t,f.path,f.title||f.path):a(t,f.path,f.title||f.path,d),g=[i.frontmatter.sidebarDepth,p,c.sidebarDepth,s.sidebarDepth,1].find(function(t){return void 0!==t}),m=c.displayAllHeaders||s.displayAllHeaders;return"auto"===f.type?[v,u(t,f.children,f.basePath,o,g)]:(d||m)&&f.headers&&!r.d.test(f.path)?[v,u(t,Object(r.c)(f.headers),f.path,o,g)]:v}};n(184);function l(t,e){return"group"===e.type&&e.children.some(function(e){return"group"===e.type?l(t,e):"page"===e.type&&Object(r.e)(t,e.path)})}var f={name:"SidebarLinks",components:{SidebarGroup:s,SidebarLink:Object(o.a)(c,void 0,void 0,!1,null,null,null).exports},props:["items","depth","sidebarDepth"],data:function(){return{openGroupIndex:0}},created:function(){this.refreshIndex()},watch:{$route:function(){this.refreshIndex()}},methods:{refreshIndex:function(){var t=function(t,e){for(var n=0;n-1&&(this.openGroupIndex=t)},toggleGroup:function(t){this.openGroupIndex=t===this.openGroupIndex?-1:t},isActive:function(t){return Object(r.e)(this.$route,t.regularPath)}}},p=Object(o.a)(f,function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.items.length?n("ul",{staticClass:"sidebar-links"},t._l(t.items,function(e,r){return n("li",{key:r},["group"===e.type?n("SidebarGroup",{attrs:{item:e,open:r===t.openGroupIndex,collapsable:e.collapsable||e.collapsible,depth:t.depth},on:{toggle:function(e){return t.toggleGroup(r)}}}):n("SidebarLink",{attrs:{sidebarDepth:t.sidebarDepth,item:e}})],1)}),0):t._e()},[],!1,null,null,null);e.default=p.exports},function(t,e,n){"use strict";var r={name:"DropdownTransition",methods:{setHeight:function(t){t.style.height=t.scrollHeight+"px"},unsetHeight:function(t){t.style.height=""}}},i=(n(162),n(0)),o=Object(i.a)(r,function(){var t=this.$createElement;return(this._self._c||t)("transition",{attrs:{name:"dropdown"},on:{enter:this.setHeight,"after-enter":this.unsetHeight,"before-leave":this.setHeight}},[this._t("default")],2)},[],!1,null,null,null);e.a=o.exports},function(t,e,n){"use strict";var r=n(33),i=n(99),o=n(36),s=n(28);t.exports=n(100)(Array,"Array",function(t,e){this._t=s(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,i(1)):i(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){"use strict";var r=n(101),i=n(18),o=n(25),s=n(14),a=n(19),u=n(36),c=n(103),l=n(76),f=n(108),p=n(10)("iterator"),h=!([].keys&&"next"in[].keys()),d=function(){return this};t.exports=function(t,e,n,v,g,m,b){c(n,e,v);var y,x,_,k=function(t){if(!h&&t in w)return w[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},S=e+" Iterator",L="values"==g,O=!1,w=t.prototype,C=w[p]||w["@@iterator"]||g&&w[g],j=!h&&C||k(g),$=g?L?k("entries"):j:void 0,T="Array"==e&&w.entries||C;if(T&&(_=f(T.call(new t)))!==Object.prototype&&_.next&&(l(_,S,!0),r||a(_,p)||s(_,p,d)),L&&C&&"values"!==C.name&&(O=!0,j=function(){return C.call(this)}),r&&!b||!h&&!O&&w[p]||s(w,p,j),u[e]=j,u[S]=d,g)if(y={values:L?j:k("values"),keys:m?j:k("keys"),entries:$},b)for(x in y)x in w||o(w,x,y[x]);else i(i.P+i.F*(h||O),e,y);return y}},function(t,e){t.exports=!1},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){"use strict";var r=n(104),i=n(35),o=n(76),s={};n(14)(s,n(10)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=r(s,{next:i(1,n)}),o(t,e+" Iterator")}},function(t,e,n){var r=n(23),i=n(105),o=n(42),s=n(41)("IE_PROTO"),a=function(){},u=function(){var t,e=n(69)("iframe"),r=o.length;for(e.style.display="none",n(107).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write(" + + diff --git a/docs/.vuepress/dist/guide/component/SchemaFormItem.html b/docs/.vuepress/dist/guide/component/SchemaFormItem.html new file mode 100644 index 0000000..675cb9f --- /dev/null +++ b/docs/.vuepress/dist/guide/component/SchemaFormItem.html @@ -0,0 +1,27 @@ + + + + + + SchemaFormItem | Element Schema Form + + + + + + + + + + + diff --git a/docs/.vuepress/dist/guide/component/index.html b/docs/.vuepress/dist/guide/component/index.html new file mode 100644 index 0000000..49f8c29 --- /dev/null +++ b/docs/.vuepress/dist/guide/component/index.html @@ -0,0 +1,25 @@ + + + + + + 组件 | Element Schema Form + + + + + + + + + + + diff --git a/docs/.vuepress/dist/guide/component/layout.html b/docs/.vuepress/dist/guide/component/layout.html new file mode 100644 index 0000000..89e1cb2 --- /dev/null +++ b/docs/.vuepress/dist/guide/component/layout.html @@ -0,0 +1,29 @@ + + + + + + 简介 | Element Schema Form + + + + + + + +

简介

SchemaForm 整体布局采用 el-row 和 el-col 进行分装, 通过基础的24分栏,迅速简便地创建布局

layout Attributes

参数 说明 类型 可选值 默认值
gutter 栅格间隔 number 0
type 布局模式,可选 flex,现代浏览器下有效 string
justify flex布局下的水平排列方式 string start/end/center/space-around/space-between start
align flex布局下的垂直排列方式 string top/middle/bottom top
tag 自定义元素标签 string * div

colGrid Attributes

参数 说明 类型 可选值 默认值
span 栅格占据的列数 number 24
offset 栅格左侧的间隔格数 number 0
push 栅格向右移动格数 number 0
pull 栅格向左移动格数 number 0
xs <768px 响应式栅格数或者栅格属性对象 number/object (例如: {span: 4, offset: 4})
sm ≥768px 响应式栅格数或者栅格属性对象 number/object (例如: {span: 4, offset: 4})
md ≥992px 响应式栅格数或者栅格属性对象 number/object (例如: {span: 4, offset: 4})
lg ≥1200px 响应式栅格数或者栅格属性对象 number/object (例如: {span: 4, offset: 4})
xl ≥1920px 响应式栅格数或者栅格属性对象 number/object (例如: {span: 4, offset: 4})
tag 自定义元素标签 string * div
+ + + diff --git a/docs/.vuepress/dist/guide/component/schema.html b/docs/.vuepress/dist/guide/component/schema.html new file mode 100644 index 0000000..4dc1540 --- /dev/null +++ b/docs/.vuepress/dist/guide/component/schema.html @@ -0,0 +1,64 @@ + + + + + + 数据字段 prop | Element Schema Form + + + + + + + +

数据字段 prop

prop 是辨别当前组件的唯一字段,既是 model 和 options 的键值 key,又是el-form 使用 validate、resetFields 方法的必填字段,所以需保证 prop的 唯一性

组件类型 type

SchemaForm 的组件是基于 Element 进行分装,目标是完美兼容原组件的所有属性

内置类型

类型 含义 属性参考
input 输入框 el-input
select 选择器 el-select
radio 单选框组 el-radio-group
checkbox 多选框组 el-checkbox-group
cascader 级联选择器 el-cascader
switch 开关 el-switch
slider 滑块 el-slider
datepicker 日期选择器 el-date-picker
timeselect 时间选择器 el-time-select
colorpicker 颜色选择器 el-color-picker
progress 进度条 el-progress
rate 评分 el-rate

表单属性 formItem

兼容所有el-form-item的属性,以下内容为常用属性
参数 说明 类型 可选值 默认值
label 标签文本 string
label-width 表单域标签的的宽度,例如 '50px'。支持 auto string
show-message 是否显示校验错误信息 boolean true
inline-message 以行内形式展示校验信息 boolean false
size 用于控制该表单域下组件的尺寸 string medium / small / mini -

绑定值修饰符 modifier

为了更好的支持数值绑定,增加了v-model的修饰符,现支持
参数 说明
number 自动将用户的输入值转为数值类型
trim 自动过滤用户输入的首尾空白字符

属性绑定 attrs

支持Element组件的属性,以el-input为例,具体参数 可参考 Element
 {
+   type: 'input',
+   prop: 'name',
+   attrs: { type: 'textarea' }
+ }
+

动态属性绑定 dynamicAttrs

除了绑定的静态属性外,还支持动态属性的绑定,例如用于与其它操作联动
 {
+   type: 'input',
+   prop: 'name',
+   dynamicAttrs: { disabled: !!this.model.id }
+ }
+

事件绑定 on

支持Element组件的事件,以el-input为例,具体参数 可参考 Element
 {
+   type: 'input',
+   prop: 'name',
+   on: { focus: this.onNameFocus }
+ }
+

事件 & 按键修饰符

对于 .passive、.capture 和 .once 这些事件修饰符, Vue 提供了相应的前缀可以用于 on
修饰符 前缀
.passive &
.capture !
.once ~
.capture.once 或 .once.capture ~!
on: {
+  '!click': this.doThisInCapturingMode,
+  '~keyup': this.doThisOnce,
+  '~!mouseover': this.doThisOnceInCapturingMode
+}
+
对于所有其它的修饰符,私有前缀都不是必须的,因为你可以在事件处理函数中使用事件方法:
on: {
+  keyup: function (event) {
+    // .self 等价于 如果触发事件的元素不是事件绑定的元素则返回
+    if (event.target !== event.currentTarget) return
+    // 如果按下去的不是 enter 键或者
+    // 没有同时按下 shift 键
+    // 则返回
+    if (!event.shiftKey || event.keyCode !== 13) return
+    // 阻止 事件冒泡
+    event.stopPropagation()
+    // 阻止该元素默认的 keyup 事件
+    event.preventDefault()
+    // ...
+  }
+}
+

插槽 slot

参数 说明
slot 自定义完整组件
frontSlot 定义element 组件前的插槽
compSlot 定义element 组件内的插槽
rearSlot 定义element 组件后的插槽
+ + + diff --git a/docs/.vuepress/dist/guide/index.html b/docs/.vuepress/dist/guide/index.html new file mode 100644 index 0000000..24cc770 --- /dev/null +++ b/docs/.vuepress/dist/guide/index.html @@ -0,0 +1,27 @@ + + + + + + 介绍 | Element Schema Form + + + + + + + + + + + diff --git "a/docs/.vuepress/dist/guide/\345\234\250\347\272\277\347\244\272\344\276\213.html" "b/docs/.vuepress/dist/guide/\345\234\250\347\272\277\347\244\272\344\276\213.html" new file mode 100644 index 0000000..53fbc8f --- /dev/null +++ "b/docs/.vuepress/dist/guide/\345\234\250\347\272\277\347\244\272\344\276\213.html" @@ -0,0 +1,29 @@ + + + + + + 在线示例 | Element Schema Form + + + + + + + + + + + diff --git "a/docs/.vuepress/dist/guide/\345\277\253\351\200\237\345\274\200\345\247\213.html" "b/docs/.vuepress/dist/guide/\345\277\253\351\200\237\345\274\200\345\247\213.html" new file mode 100644 index 0000000..d7b4cd4 --- /dev/null +++ "b/docs/.vuepress/dist/guide/\345\277\253\351\200\237\345\274\200\345\247\213.html" @@ -0,0 +1,56 @@ + + + + + + 快速开始 | Element Schema Form + + + + + + + +

安装

npm i vue-schema-form -S
+

or

yarn add vue-schema-form
+

引入组件

完整引入

import SchemaForm from 'vue-schema-form'
+
+Vue.use(SchemaForm)
+

引入第三方扩展

SchemaForm 支持一些用于表单渲染的高级组件,例如富文本编辑器、代码编辑器、JSON编辑器、Markdown编辑器等

Vue.component('SchemaFormJsoneditor', SchemaFormJsoneditor)
+Vue.component('SchemaFormQuill', SchemaFormQuill)
+Vue.component('SchemaFormCodemirror', SchemaFormCodemirror)
+

组件预设配置

// input 框 placeholder 预设
+Vue.use(SchemaForm, {
+  input: {
+    placeholder: '全局定义变量实验'
+  }
+})
+
+// codemirror 插件配置项预设
+Vue.use(SchemaForm, {
+  'codemirror': {
+    cmOptions: {
+      tabSize: 2,
+      mode: 'text/javascript',
+      theme: 'cobalt',
+      lineNumbers: true,
+      line: true
+    }
+  }
+})
+
+ + + diff --git "a/docs/.vuepress/dist/guide/\346\233\264\346\226\260\346\227\245\345\277\227.html" "b/docs/.vuepress/dist/guide/\346\233\264\346\226\260\346\227\245\345\277\227.html" new file mode 100644 index 0000000..d9bd71d --- /dev/null +++ "b/docs/.vuepress/dist/guide/\346\233\264\346\226\260\346\227\245\345\277\227.html" @@ -0,0 +1,29 @@ + + + + + + 更新日志 | Element Schema Form + + + + + + + + + + + diff --git a/docs/.vuepress/dist/index.html b/docs/.vuepress/dist/index.html new file mode 100644 index 0000000..6c5b498 --- /dev/null +++ b/docs/.vuepress/dist/index.html @@ -0,0 +1,29 @@ + + + + + + Element Schema Form + + + + + + + +

Element Schema Form

+ 基于 JSON Schema 构建 Element 表单 +

快速开始 →

Schema Form Based

基于 JSON 数据结构的 Schema。

Element Based

基于 Element UI组件库的 Form 表单。

Responsable Form

响应式的栅格表单布局。

基础组件

支持 Element 内置常用的 10 余种表单组件,如 Input、Select、Radio、Checkbox 等。

第三方组件

支持常用第三方表单组件,如富文本编辑器、MarkDown编辑器等。

自定义组件

基于 `Slot` 的自定义组件功能,留给你可扩展的自定义功能。

+ + + diff --git a/docs/.vuepress/styles/index.styl b/docs/.vuepress/styles/index.styl new file mode 100644 index 0000000..5e1cb27 --- /dev/null +++ b/docs/.vuepress/styles/index.styl @@ -0,0 +1,9 @@ + +table thead th { + color: #909399; + font-size: 14px; +} +table tbody td { + color: #606266; + font-size: 14px; +} \ No newline at end of file diff --git a/docs/guide/component/SchemaForm.md b/docs/guide/component/SchemaForm.md index 8f660d1..e31a1f5 100644 --- a/docs/guide/component/SchemaForm.md +++ b/docs/guide/component/SchemaForm.md @@ -4,9 +4,6 @@ } --- -## SchemaForm - -**SchemaForm** ### 组件使用 @@ -45,8 +42,50 @@ export default { #### layout +##### 表单布局信息,详见 [layout布局](layout.html) + + #### model +##### 表单数据对象,表单绑定值的集合,例如 +``` js +{ + model: { + name: '', + age: '' + } +} +``` + #### schema +##### 表单模板,用于表单的构建。详情见 [schema 详解](schema.html) + +参数|说明|类型|可选值|默认值 +:--|:--|:--|:--|:-- +prop|数据字段|string|-|- +type|组件类型|string|-|- +formItem|表单属性|object|-|- +modifier|修饰符|string|number,trim|- +attrs|组件属性|object|-|- +dynamicAttrs|组件动态属性| object|-|- +on|组件事件|object|-|- +hide|是否隐藏|boolean|-|false +colGrid|栅格布局,与el-col属性相同|object|-|- + +#### options -#### options \ No newline at end of file +##### 表单可选数据源,如我们常用的 el-select 的数据源 +``` js +{ + options: { + foods: [ + { + value: '选项1', + label: '黄金糕' + }, { + value: '选项2', + label: '双皮奶' + }] + } +} +``` \ No newline at end of file diff --git a/docs/guide/component/layout.md b/docs/guide/component/layout.md new file mode 100644 index 0000000..8f2b141 --- /dev/null +++ b/docs/guide/component/layout.md @@ -0,0 +1,29 @@ + +### 简介 + +SchemaForm 整体布局采用 el-row 和 el-col 进行分装, 通过基础的24分栏,迅速简便地创建布局 + + +**layout Attributes** + +参数|说明|类型|可选值|默认值 +:--|:--|:--|:--|:--| +gutter|栅格间隔|number|—|0 +type|布局模式,可选 flex,现代浏览器下有效|string|—|— +justify|flex布局下的水平排列方式|string|start/end/center/space-around/space-between|start +align|flex布局下的垂直排列方式|string|top/middle/bottom|top +tag|自定义元素标签|string|*|div + +**colGrid Attributes** +参数|说明|类型|可选值|默认值 +:--|:--|:--|:--|:--| +span|栅格占据的列数|number|—|24 +offset|栅格左侧的间隔格数|number|—|0 +push|栅格向右移动格数|number|—|0 +pull|栅格向左移动格数|number|—|0 +xs|<768px|响应式栅格数或者栅格属性对象|number/object (例如: {span: 4, offset: 4})|—|— +sm|≥768px|响应式栅格数或者栅格属性对象|number/object (例如: {span: 4, offset: 4})|—|— +md|≥992px|响应式栅格数或者栅格属性对象|number/object (例如: {span: 4, offset: 4})|—|— +lg|≥1200px|响应式栅格数或者栅格属性对象|number/object (例如: {span: 4, offset: 4})|—|— +xl|≥1920px|响应式栅格数或者栅格属性对象|number/object (例如: {span: 4, offset: 4})|—|— +tag|自定义元素标签|string * div diff --git a/docs/guide/component/schema.md b/docs/guide/component/schema.md new file mode 100644 index 0000000..54b0ec7 --- /dev/null +++ b/docs/guide/component/schema.md @@ -0,0 +1,124 @@ +## 数据字段 prop + +##### prop 是辨别当前组件的唯一字段,既是 ```model 和 options 的键值 key ```,又是```el-form``` 使用 ```validate、resetFields``` 方法的必填字段,所以需保证 prop的 唯一性 + +## 组件类型 type + +##### SchemaForm 的组件是基于 Element 进行分装,目标是完美兼容原组件的所有属性 + +#### 内置类型 + +类型|含义|属性参考 +:--|:--|:-- +input| 输入框 | [el-input](https://element.eleme.cn/#/zh-CN/component/input) +select| 选择器 | [el-select](https://element.eleme.cn/#/zh-CN/component/select) +radio| 单选框组 | [el-radio-group](https://element.eleme.cn/#/zh-CN/component/radio) +checkbox| 多选框组 | [el-checkbox-group](https://element.eleme.cn/#/zh-CN/component/checkbox) +cascader| 级联选择器 | [el-cascader](https://element.eleme.cn/#/zh-CN/component/cascader) +switch| 开关 | [el-switch](https://element.eleme.cn/#/zh-CN/component/switch) +slider| 滑块 | [el-slider](https://element.eleme.cn/#/zh-CN/component/slider) +datepicker| 日期选择器 | [el-date-picker](https://element.eleme.cn/#/zh-CN/component/date-picker) +timeselect| 时间选择器 | [el-time-select](https://element.eleme.cn/#/zh-CN/component/time-picker) +colorpicker| 颜色选择器 | [el-color-picker](https://element.eleme.cn/#/zh-CN/component/color-picker) +progress| 进度条 | [el-progress](https://element.eleme.cn/#/zh-CN/component/progress) +rate| 评分 | [el-rate](https://element.eleme.cn/#/zh-CN/component/rate) + +## 表单属性 formItem + +##### 兼容所有el-form-item的属性,以下内容为常用属性 + +参数|说明|类型|可选值|默认值 +:--|:--|:--|:--|:-- +label|标签文本|string|—|— +label-width|表单域标签的的宽度,例如 '50px'。支持 auto|string|—|— +show-message|是否显示校验错误信息|boolean|—|true +inline-message|以行内形式展示校验信息|boolean|—|false +size|用于控制该表单域下组件的尺寸|string|medium / small / mini|- + +## 绑定值修饰符 modifier + +##### 为了更好的支持数值绑定,增加了```v-model```的修饰符,现支持 + +参数|说明 +:--|:-- +number|自动将用户的输入值转为数值类型 +trim|自动过滤用户输入的首尾空白字符 + +## 属性绑定 attrs + +##### 支持Element组件的属性,以```el-input```为例,具体参数 可参考 [Element](https://element.eleme.cn/#/zh-CN) +``` js + { + type: 'input', + prop: 'name', + attrs: { type: 'textarea' } + } +``` + +## 动态属性绑定 dynamicAttrs + +##### 除了绑定的静态属性外,还支持动态属性的绑定,例如用于与其它操作联动 +``` js + { + type: 'input', + prop: 'name', + dynamicAttrs: { disabled: !!this.model.id } + } +``` +## 事件绑定 on + +##### 支持Element组件的事件,以```el-input```为例,具体参数 可参考 [Element](https://element.eleme.cn/#/zh-CN) +``` js + { + type: 'input', + prop: 'name', + on: { focus: this.onNameFocus } + } +``` +#### 事件 & 按键修饰符 + +##### 对于 .passive、.capture 和 .once 这些事件修饰符, Vue 提供了相应的前缀可以用于 on + +修饰符|前缀 +:--|:-- +.passive|& +.capture|! +.once|~ +.capture.once 或 .once.capture|~! + +``` js +on: { + '!click': this.doThisInCapturingMode, + '~keyup': this.doThisOnce, + '~!mouseover': this.doThisOnceInCapturingMode +} +``` + +##### 对于所有其它的修饰符,私有前缀都不是必须的,因为你可以在事件处理函数中使用事件方法: +``` js +on: { + keyup: function (event) { + // .self 等价于 如果触发事件的元素不是事件绑定的元素则返回 + if (event.target !== event.currentTarget) return + // 如果按下去的不是 enter 键或者 + // 没有同时按下 shift 键 + // 则返回 + if (!event.shiftKey || event.keyCode !== 13) return + // 阻止 事件冒泡 + event.stopPropagation() + // 阻止该元素默认的 keyup 事件 + event.preventDefault() + // ... + } +} +``` + +## 插槽 slot + +参数|说明| +:--|:-- +slot| 自定义完整组件 +frontSlot| 定义element 组件前的插槽 +compSlot| 定义element 组件内的插槽 +rearSlot| 定义element 组件后的插槽 + diff --git a/lib/demo.html b/lib/demo.html index 750b2ff..78d07f9 100644 --- a/lib/demo.html +++ b/lib/demo.html @@ -1,8 +1,8 @@ -element-form-generator demo - +element-schema-form demo + diff --git a/lib/element-form-generator.common.js b/lib/element-form-generator.common.js deleted file mode 100644 index d791e18..0000000 --- a/lib/element-form-generator.common.js +++ /dev/null @@ -1,28194 +0,0 @@ -module.exports = -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = "fb15"); -/******/ }) -/************************************************************************/ -/******/ ({ - -/***/ "1fb5": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.byteLength = byteLength -exports.toByteArray = toByteArray -exports.fromByteArray = fromByteArray - -var lookup = [] -var revLookup = [] -var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array - -var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' -for (var i = 0, len = code.length; i < len; ++i) { - lookup[i] = code[i] - revLookup[code.charCodeAt(i)] = i -} - -// Support decoding URL-safe base64 strings, as Node.js does. -// See: https://en.wikipedia.org/wiki/Base64#URL_applications -revLookup['-'.charCodeAt(0)] = 62 -revLookup['_'.charCodeAt(0)] = 63 - -function getLens (b64) { - var len = b64.length - - if (len % 4 > 0) { - throw new Error('Invalid string. Length must be a multiple of 4') - } - - // Trim off extra bytes after placeholder bytes are found - // See: https://github.com/beatgammit/base64-js/issues/42 - var validLen = b64.indexOf('=') - if (validLen === -1) validLen = len - - var placeHoldersLen = validLen === len - ? 0 - : 4 - (validLen % 4) - - return [validLen, placeHoldersLen] -} - -// base64 is 4/3 + up to two characters of the original data -function byteLength (b64) { - var lens = getLens(b64) - var validLen = lens[0] - var placeHoldersLen = lens[1] - return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen -} - -function _byteLength (b64, validLen, placeHoldersLen) { - return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen -} - -function toByteArray (b64) { - var tmp - var lens = getLens(b64) - var validLen = lens[0] - var placeHoldersLen = lens[1] - - var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)) - - var curByte = 0 - - // if there are placeholders, only get up to the last complete 4 chars - var len = placeHoldersLen > 0 - ? validLen - 4 - : validLen - - var i - for (i = 0; i < len; i += 4) { - tmp = - (revLookup[b64.charCodeAt(i)] << 18) | - (revLookup[b64.charCodeAt(i + 1)] << 12) | - (revLookup[b64.charCodeAt(i + 2)] << 6) | - revLookup[b64.charCodeAt(i + 3)] - arr[curByte++] = (tmp >> 16) & 0xFF - arr[curByte++] = (tmp >> 8) & 0xFF - arr[curByte++] = tmp & 0xFF - } - - if (placeHoldersLen === 2) { - tmp = - (revLookup[b64.charCodeAt(i)] << 2) | - (revLookup[b64.charCodeAt(i + 1)] >> 4) - arr[curByte++] = tmp & 0xFF - } - - if (placeHoldersLen === 1) { - tmp = - (revLookup[b64.charCodeAt(i)] << 10) | - (revLookup[b64.charCodeAt(i + 1)] << 4) | - (revLookup[b64.charCodeAt(i + 2)] >> 2) - arr[curByte++] = (tmp >> 8) & 0xFF - arr[curByte++] = tmp & 0xFF - } - - return arr -} - -function tripletToBase64 (num) { - return lookup[num >> 18 & 0x3F] + - lookup[num >> 12 & 0x3F] + - lookup[num >> 6 & 0x3F] + - lookup[num & 0x3F] -} - -function encodeChunk (uint8, start, end) { - var tmp - var output = [] - for (var i = start; i < end; i += 3) { - tmp = - ((uint8[i] << 16) & 0xFF0000) + - ((uint8[i + 1] << 8) & 0xFF00) + - (uint8[i + 2] & 0xFF) - output.push(tripletToBase64(tmp)) - } - return output.join('') -} - -function fromByteArray (uint8) { - var tmp - var len = uint8.length - var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes - var parts = [] - var maxChunkLength = 16383 // must be multiple of 3 - - // go through the array every three bytes, we'll deal with trailing stuff later - for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { - parts.push(encodeChunk( - uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength) - )) - } - - // pad the end with zeros, but make sure to not forget the extra bytes - if (extraBytes === 1) { - tmp = uint8[len - 1] - parts.push( - lookup[tmp >> 2] + - lookup[(tmp << 4) & 0x3F] + - '==' - ) - } else if (extraBytes === 2) { - tmp = (uint8[len - 2] << 8) + uint8[len - 1] - parts.push( - lookup[tmp >> 10] + - lookup[(tmp >> 4) & 0x3F] + - lookup[(tmp << 2) & 0x3F] + - '=' - ) - } - - return parts.join('') -} - - -/***/ }), - -/***/ "2350": -/***/ (function(module, exports) { - -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -// css base code, injected by the css-loader -module.exports = function(useSourceMap) { - var list = []; - - // return the list of modules as css string - list.toString = function toString() { - return this.map(function (item) { - var content = cssWithMappingToString(item, useSourceMap); - if(item[2]) { - return "@media " + item[2] + "{" + content + "}"; - } else { - return content; - } - }).join(""); - }; - - // import a list of modules into the list - list.i = function(modules, mediaQuery) { - if(typeof modules === "string") - modules = [[null, modules, ""]]; - var alreadyImportedModules = {}; - for(var i = 0; i < this.length; i++) { - var id = this[i][0]; - if(typeof id === "number") - alreadyImportedModules[id] = true; - } - for(i = 0; i < modules.length; i++) { - var item = modules[i]; - // skip already imported module - // this implementation is not 100% perfect for weird media query combinations - // when a module is imported multiple times with different media queries. - // I hope this will never occur (Hey this way we have smaller bundles) - if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) { - if(mediaQuery && !item[2]) { - item[2] = mediaQuery; - } else if(mediaQuery) { - item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"; - } - list.push(item); - } - } - }; - return list; -}; - -function cssWithMappingToString(item, useSourceMap) { - var content = item[1] || ''; - var cssMapping = item[3]; - if (!cssMapping) { - return content; - } - - if (useSourceMap && typeof btoa === 'function') { - var sourceMapping = toComment(cssMapping); - var sourceURLs = cssMapping.sources.map(function (source) { - return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */' - }); - - return [content].concat(sourceURLs).concat([sourceMapping]).join('\n'); - } - - return [content].join('\n'); -} - -// Adapted from convert-source-map (MIT) -function toComment(sourceMap) { - // eslint-disable-next-line no-undef - var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); - var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; - - return '/*# ' + data + ' */'; -} - - -/***/ }), - -/***/ "2377": -/***/ (function(module, exports, __webpack_require__) { - -// style-loader: Adds some css to the DOM by adding a