神仙都没用 1 an în urmă
părinte
comite
9919390e32

+ 2 - 1
src/config/proxy.ts

@@ -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 - 1
src/modules/iot/hooks/index.ts

@@ -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;

+ 10 - 8
src/plugins/crud/components/switch/index.tsx

@@ -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

+ 2 - 2
src/plugins/crud/config.ts

@@ -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",
 
 		// 组件全注册

Fișier diff suprimat deoarece este prea mare
+ 346 - 347
yarn.lock


Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff