Skip to content

Commit

Permalink
feat(cdn): 替换cdn链接
Browse files Browse the repository at this point in the history
  • Loading branch information
lljj-x committed Feb 10, 2022
1 parent e93294f commit 245fd2c
Show file tree
Hide file tree
Showing 6 changed files with 136 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/demo/demo-v2/src/pages/index/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
<body>
<div id="app"></div>
<script src="//cdn.jsdelivr.net/npm/@lljj/polyfill@0.1.1/dist/polyfill.umd.min.js"></script>
<script src="//cdn.bootcss.com/vue/2.6.10/vue.js"></script>
<script src="//cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/element-ui@2.13.1/lib/index.js"></script>
<script src="//cdn.bootcss.com/vue-router/3.1.3/vue-router.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/vue-router@3.1.3/dist/vue-router.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/monaco-editor@0.20.0/min/vs/loader.js"></script>
<script>
require.config({ paths: { 'vs': '//cdn.jsdelivr.net/npm/monaco-editor@0.20.0/min/vs' }});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<body>
<div id="app"></div>
<script src="//cdn.jsdelivr.net/npm/@lljj/polyfill@0.1.1/dist/polyfill.umd.min.js"></script>
<script src="//cdn.bootcss.com/vue/2.6.10/vue.js"></script>
<script src="//cdn.bootcss.com/vue-router/3.1.3/vue-router.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/vue-router@3.1.3/dist/vue-router.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/element-ui@2.13.0/lib/index.js"></script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<template>
<TestDemo v-if="false"></TestDemo>
<div
v-else
v-loading="loading"
:class="{
[$style.previewBox]: isPreview
Expand Down Expand Up @@ -136,6 +138,7 @@ import * as arrayMethods from 'demo-common/utils/array';
import componentWithDialog from 'demo-common/components/component-with-dialog';
import JsonPerttyPrint from 'demo-common/components/JsonPerttyPrint.vue';
import TestDemo from './TestDemo';
import EditorToolBar from './EditorToolBar.vue';
import EditorHeader from './EditorHeader.vue';
import ViewComponentWrap from './components/ViewComponentWrap.vue';
Expand All @@ -157,6 +160,7 @@ export default {
name: 'Editor',
components: {
...components,
TestDemo,
VueElementForm,
Draggable,
EditorToolBar,
Expand Down
125 changes: 125 additions & 0 deletions packages/demo/demo-v2/src/pages/vue-editor/views/editor/TestDemo.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
<template>
<div
v-if="true"
class="demo-wrapper"
>
<VueElementForm
v-model="formData"
class="demo-form-box"
:schema="schema"
@on-submit="handleSubmit"
>
</VueElementForm>
</div>
</template>

<script>
import VueElementForm from '@lljj/vue-json-schema-form/src/index';
export default {
components: {
VueElementForm
},
data() {
return {
formData: {
item: [
{
text: '作者'
},
{
imgUrl: '',
step: 1,
text: '机构'
}
]
},
schema: {
title: 'DEMO',
type: 'object',
properties: {
item: {
title: '左侧点击栏目',
type: 'array',
required: [],
minItems: 1,
items: {
title: '栏目类型',
type: 'object',
anyOf: [
{
title: '唯一可点击栏目',
required: ['text', 'imgUrl', 'step'],
properties: {
text: {
type: 'string',
title: '栏目名称'
},
imgUrl: {
title: '点击弹出图',
type: 'string',
},
step: {
title: '第一步',
type: 'number',
const: 1,
default: 1,
'ui:disabled': true,
'ui:hidden': true
}
}
},
{
title: '其他栏目',
required: ['text'],
properties: {
text: {
type: 'string',
title: '栏目名称'
}
}
}
]
}
}
}
},
};
},
created() {
// 初始数据
// this.formData = {
// item: [
// {
// text: '作者'
// },
// {
// imgUrl: '',
// step: 1,
// text: '机构'
// }
// ]
// };
},
methods: {
handleSubmit(formData) {
debugger;
}
}
};
</script>


<style scoped>
.demo-wrapper {
z-index: 1000;
position: fixed;
width: 100%;
height: 100%;
background: #FFFFFF;
}
.demo-form-box {
margin: 0 auto;
width: 600px;
}
</style>
4 changes: 2 additions & 2 deletions packages/demo/demo-v2/src/pages/vue-editor/vue-editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<body>
<div id="app"></div>
<script src="//cdn.jsdelivr.net/npm/@lljj/polyfill@0.1.1/dist/polyfill.umd.min.js"></script>
<script src="//cdn.bootcss.com/vue/2.6.10/vue.js"></script>
<script src="//cdn.bootcss.com/vue-router/3.1.3/vue-router.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/vue-router@3.1.3/dist/vue-router.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/element-ui@2.13.0/lib/index.js"></script>
</body>
</html>
1 change: 1 addition & 0 deletions packages/lib/vue2/vue2-core/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export default function createForm(globalOptions = {}) {
data() {
const formData = getDefaultFormState(this.$props.schema, this.$props.value, this.$props.schema);

debugger;
// 保持v-model双向数据及时性
this.emitFormDataChange(formData, this.value);

Expand Down

0 comments on commit 245fd2c

Please sign in to comment.