Skip to content

Commit

Permalink
feat:调整
Browse files Browse the repository at this point in the history
  • Loading branch information
taosin committed Jun 20, 2020
1 parent 629ed41 commit f9b50a4
Show file tree
Hide file tree
Showing 5 changed files with 278 additions and 53 deletions.
2 changes: 1 addition & 1 deletion h5/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import router from './router/index.js'

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(ElementUI)
Vue.use(ElementUI, { size: 'mini' })

import VueI18n from 'vue-i18n'
Vue.use(VueI18n)
Expand Down
89 changes: 60 additions & 29 deletions h5/src/store/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,59 @@ const layout = {
state: {
elements: [
{
name: "el-form",
name: 'el-form',
props: {
"label-width": "180px",
"label-position": "rigth",
'label-width': '180px',
'label-position': 'rigth',
},
children: [
{
name: "el-form-item",
name: 'el-form-item',
props: {
label: "姓名",
value: "3131",
label: '姓名',
value: '3131',
},
children: [
{
name: "el-input",
name: 'el-input',
props: {
type: "textarea",
size: "large",
value: "3131",
"v-model": "sddsds",
type: 'textarea',
size: 'large',
value: '3131',
'v-model': 'sddsds',
},
text: "username",
text: 'username',
},
],
},
{
name: "el-form-item",
name: 'el-form-item',
props: {
label: "请选择请选择请选择请选择",
label: '请选择请选择请选择请选择',
},
children: [
{
name: "el-select",
name: 'el-select',
props: {
size: "small",
placeholder: "请选择",
"v-model": "type",
value: "1",
size: 'small',
placeholder: '请选择',
'v-model': 'type',
value: '1',
clearable: true,
},
children: [
{
name: "el-option",
text: "选项一",
name: 'el-option',
text: '选项一',
props: {
value: "type",
value: 'type',
},
},
{
name: "el-option",
text: "选项e",
name: 'el-option',
text: '选项e',
props: {
value: "2",
value: '2',
},
},
],
Expand All @@ -64,17 +64,48 @@ const layout = {
],
},
],
layouts: [
{
type: 'layout-container',
x: 0,
y: 0,
w: 24,
h: 4,
static: false,
i: 0,
children: [
{
type: 'form',
children: [
{
type: 'button',
},
{
type: 'input',
},
{
type: 'select',
},
],
},
{
type: 'table',
columns: [{}],
},
],
},
],
},
mutations: {
updateElements: (state, payload) => {
state.elements = payload;
state.elements = payload
},
},
actions: {
updateElements: ({ commit }, payload) => {
commit("updateElements", payload);
commit('updateElements', payload)
},
},
getters: {},
};
export default layout;
}
export default layout
8 changes: 4 additions & 4 deletions h5/src/views/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
</div>
</template>
<script>
import sider from '@/layout/dashboard/sider'
import top from '@/layout/dashboard/header'
import workMeta from '@/layout/dashboard/workmeta'
import right from '@/layout/dashboard/right/index'
import sider from './layout/dashboard/sider'
import top from './layout/dashboard/header'
import workMeta from './layout/dashboard/workmeta'
import right from './layout/dashboard/right/index'
export default {
data() {
return {}
Expand Down
20 changes: 8 additions & 12 deletions h5/src/views/layout/dashboard/componentItems.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,35 @@
</template>

<script>
import componentItem from "./componentItem";
import { mapState, mapActions } from "vuex";
import componentItem from './componentItem'
import { mapState, mapActions } from 'vuex'
export default {
components: {
componentItem,
draggable: () => import("vuedraggable"),
draggable: () => import('vuedraggable'),
},
data() {
return {};
return {}
},
computed: {
items: {
get() {
return this.$store.state.layout.elements;
return this.$store.state.layout.elements
},
set(value) {
this.updateElements(value);
this.updateElements(value)
},
},
},
methods: {
...mapActions(["updateElements"]),
...mapActions(['updateElements']),
},
};
}
</script>

<style lang="less" scoped>
.view {
width: 100%;
height: 100%;
}
/deep/ form.el-form.el-form--label-rigth {
border: 1px solid orange;
padding: 5px;
}
</style>
Loading

0 comments on commit f9b50a4

Please sign in to comment.