mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2025-12-14 06:42:51 +00:00
优化
This commit is contained in:
parent
5219edd281
commit
9919390e32
@ -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/, "")
|
||||
},
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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",
|
||||
|
||||
// 组件全注册
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user