This commit is contained in:
神仙都没用 2024-02-28 11:41:53 +08:00
parent 5219edd281
commit 9919390e32
5 changed files with 553 additions and 528 deletions

View File

@ -1,6 +1,7 @@
export const proxy = {
"/dev/": {
target: "http://127.0.0.1:8001",
target: "https://test-admin.cool-js.cloud",
// target: "http://127.0.0.1:8001",
changeOrigin: true,
rewrite: (path: string) => path.replace(/^\/dev/, "")
},

View File

@ -1,4 +1,4 @@
import * as mqtt from "mqtt/dist/mqtt.min";
import mqtt from "mqtt/dist/mqtt.min";
import { useCool } from "/@/cool";
let client: mqtt.MqttClient;

View File

@ -1,6 +1,6 @@
import { useCrud } from "@cool-vue/crud";
import { ElMessage } from "element-plus";
import { defineComponent, nextTick, ref, watch } from "vue";
import { defineComponent, ref, watch } from "vue";
import { isBoolean, isFunction } from "lodash-es";
export default defineComponent({
@ -10,7 +10,6 @@ export default defineComponent({
scope: null,
column: null,
modelValue: [Number, String, Boolean],
api: Function,
activeValue: {
type: [Number, String, Boolean],
default: 1
@ -18,7 +17,8 @@ export default defineComponent({
inactiveValue: {
type: [Number, String, Boolean],
default: 0
}
},
api: Function
},
emits: ["update:modelValue", "change"],
@ -30,15 +30,19 @@ export default defineComponent({
// 状态
const status = ref<boolean | number | string>();
// 选中值类型
const activeValue = ref();
const inactiveValue = ref();
// 监听值
watch(
() => props.modelValue,
(val) => {
// 首次获取类型
if (activeValue.value === undefined) {
if (isBoolean(props.modelValue)) {
status.value = val;
if (val !== undefined) {
// 调整值类型
if (isBoolean(val)) {
activeValue.value = true;
inactiveValue.value = false;
} else {
@ -46,8 +50,6 @@ export default defineComponent({
inactiveValue.value = props.inactiveValue;
}
}
status.value = val;
},
{
immediate: true

View File

@ -13,8 +13,8 @@ export default (): Merge<ModuleConfig, CrudOptions> => {
label: "CRUD",
description: "快速增删改查及一系列辅助组件",
author: "COOL",
version: "1.0.4",
updateTime: "2024-02-27",
version: "1.0.5",
updateTime: "2024-02-28",
demo: "/demo/crud",
// 组件全注册

1054
yarn.lock

File diff suppressed because it is too large Load Diff