Skip to content

Commit

Permalink
发布 借助ai快速封装
Browse files Browse the repository at this point in the history
  • Loading branch information
duolabmeng6 committed Nov 3, 2023
1 parent 9278598 commit 6dae608
Show file tree
Hide file tree
Showing 5 changed files with 113 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,7 @@ let enventNames = ref([
onMounted(() => {
console.log("ButtonAttr.vue onMounted");
console.log("--",localStorage.getItem("locale") );
if (localStorage.getItem("locale") === "English") {
console.log("英语");
shapeOptions.value.forEach((item) => {
item.label = item.value;
});
Expand Down
13 changes: 4 additions & 9 deletions GoEasyDesigner/frontend/src/components/boxs/td/Link/LinkAttr.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,11 @@
</el-form-item>
</el-form>

<component
is="common-event-component"
:item="props.item"
:eventName="enventNames"
/>


</div>
<component is="common-event-component" :item="props.item" :eventName="enventNames"/>

</template>

<script setup>
Expand All @@ -86,11 +85,7 @@ let enventNames = ref([
]);
onMounted(() => {
console.log("LinkButtonPropertiesTable.vue onMounted");
console.log("--", localStorage.getItem("locale"));
if (localStorage.getItem("locale") === "English") {
console.log("英语");
sizeOptions.value.forEach((item) => {
item.label = item.value;
});
Expand Down
17 changes: 17 additions & 0 deletions GoEasyDesigner/frontend/src/components/boxs/td/Switch/Switch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export default {
top: "0",
left: "0",
width: "80",
height: "32",
noPlace: true,
visible: true,
disable: false,
zIndex: 0,
customListening:true,

customValue: [true, false],
label: ['yes','no'],
loading: false,
size: "medium",
value: false,
}
28 changes: 28 additions & 0 deletions GoEasyDesigner/frontend/src/components/boxs/td/Switch/Switch.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<template>
<t-switch
:label="item.label"
:loading="item.loading"
:size="item.size"
v-model="item.value"
@change="handleChange"
/>

</template>

<script setup>
import {getItemStyle} from "@/public";
import {defineEmits, defineProps} from "vue";
const {item} = defineProps(['item'])
const emits = defineEmits(["CustomEvent"]);
function onSendEvent(name, data) {
emits("CustomEvent", name, data);
}
function handleChange() {
onSendEvent('数据发生变化', item)
}
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<template>
<div class="属性表格">
<el-form
label-position="left"
label-width="100px"
style="max-width: 460px"
>
<component is="common-properties" :item="item" />


<el-form-item label="label">
<el-input v-model="item.label[0]" />
<el-input v-model="item.label[1]" />
</el-form-item>
<el-form-item label="loading">
<el-switch v-model="item.loading" />
</el-form-item>
<el-form-item label="size">
<el-select v-model="item.size" style="width: 100%">
<el-option
v-for="(item, index) in sizeOptions"
:key="item"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="value">
<el-switch v-model="item.value" />
</el-form-item>

</el-form>


</div>
<component
is="common-event-component"
:item="item"
:eventName="eventNames"
/>
</template>

<script setup>
import { ref, defineProps, defineEmits, onMounted } from "vue";
const emits = defineEmits(["添加事件被选择"]);
const props = defineProps(["item"]);
let sizeOptions = ref([
{ label: "", value: "small" },
{ label: "", value: "medium" },
{ label: "", value: "large" },
]);
let eventNames = ref([
{ label: "数据发生变化", value: "change" },
]);
onMounted(() => {
if (localStorage.getItem("locale") === "English") {
sizeOptions.value.forEach((item) => {
item.label = item.value;
});
}
});
</script>

0 comments on commit 6dae608

Please sign in to comment.