@deot/vc 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7484,6 +7484,7 @@ var Vc = (function (exports, vue) {
7484
7484
  type: Boolean,
7485
7485
  default: true
7486
7486
  },
7487
+ // 单位ms
7487
7488
  duration: {
7488
7489
  type: Number,
7489
7490
  default: 3e3
@@ -7510,23 +7511,28 @@ var Vc = (function (exports, vue) {
7510
7511
  emit,
7511
7512
  expose
7512
7513
  }) {
7513
- const isVisible = vue.ref(false);
7514
+ const isActive = vue.ref(false);
7515
+ const currentContent = vue.ref();
7516
+ const setContent = (v) => {
7517
+ currentContent.value = v;
7518
+ };
7514
7519
  const handleRemove = () => {
7515
7520
  emit("close");
7516
7521
  emit("portal-fulfilled");
7517
7522
  };
7518
7523
  const handleClose = () => {
7519
7524
  if (props2.maskClosable) {
7520
- isVisible.value = false;
7525
+ isActive.value = false;
7521
7526
  }
7522
7527
  };
7528
+ vue.watch(() => props2.content, setContent, {
7529
+ immediate: true
7530
+ });
7523
7531
  let timer;
7524
7532
  vue.onMounted(() => {
7525
- isVisible.value = true;
7533
+ isActive.value = true;
7526
7534
  if (props2.duration !== 0) {
7527
- timer = setTimeout(() => {
7528
- isVisible.value = false;
7529
- }, props2.duration - 300);
7535
+ timer = setTimeout(() => isActive.value = false, props2.duration);
7530
7536
  }
7531
7537
  });
7532
7538
  vue.onUnmounted(() => {
@@ -7556,12 +7562,12 @@ var Vc = (function (exports, vue) {
7556
7562
  "class": "vcm-toast__wrapper"
7557
7563
  }, [props2.mode === "loading" && vue.createVNode(MSpin, {
7558
7564
  "class": "vcm-toast__loading"
7559
- }, null), typeof props2.content === "string" ? vue.createVNode("div", {
7565
+ }, null), typeof currentContent.value === "string" ? vue.createVNode("div", {
7560
7566
  "class": "vcm-toast__content",
7561
- "innerHTML": props2.content
7562
- }, null) : typeof props2.content === "function" ? vue.createVNode(MCustomer, {
7563
- "render": props2.content
7564
- }, null) : null]), [[vue.vShow, isVisible.value]])]
7567
+ "innerHTML": currentContent.value
7568
+ }, null) : typeof currentContent.value === "function" ? vue.createVNode(MCustomer, {
7569
+ "render": currentContent.value
7570
+ }, null) : null]), [[vue.vShow, isActive.value]])]
7565
7571
  })]);
7566
7572
  };
7567
7573
  }
@@ -9425,6 +9431,7 @@ var Vc = (function (exports, vue) {
9425
9431
  type: Boolean,
9426
9432
  default: true
9427
9433
  },
9434
+ // 单位ms
9428
9435
  duration: {
9429
9436
  type: Number,
9430
9437
  default: 1500
@@ -9456,6 +9463,10 @@ var Vc = (function (exports, vue) {
9456
9463
  }) {
9457
9464
  const instance = vue.getCurrentInstance();
9458
9465
  const isActive = vue.ref(false);
9466
+ const currentContent = vue.ref();
9467
+ const setContent = (v) => {
9468
+ currentContent.value = v;
9469
+ };
9459
9470
  const handleRemove = () => {
9460
9471
  emit("close");
9461
9472
  emit("portal-fulfilled");
@@ -9474,13 +9485,14 @@ var Vc = (function (exports, vue) {
9474
9485
  isActive.value = false;
9475
9486
  }
9476
9487
  };
9488
+ vue.watch(() => props2.content, setContent, {
9489
+ immediate: true
9490
+ });
9477
9491
  let timer;
9478
9492
  vue.onMounted(() => {
9479
9493
  isActive.value = true;
9480
9494
  if (props2.duration !== 0) {
9481
- timer = setTimeout(() => {
9482
- isActive.value = false;
9483
- }, props2.duration * 1e3 - 300);
9495
+ timer = setTimeout(() => isActive.value = false, props2.duration);
9484
9496
  }
9485
9497
  });
9486
9498
  vue.onUnmounted(() => {
@@ -9489,7 +9501,9 @@ var Vc = (function (exports, vue) {
9489
9501
  const exposes = ["destroy", "remove", "close", "hide"].reduce((pre, key) => {
9490
9502
  pre[key] = handleRemove;
9491
9503
  return pre;
9492
- }, {});
9504
+ }, {
9505
+ setContent
9506
+ });
9493
9507
  expose(exposes);
9494
9508
  return () => {
9495
9509
  return vue.createVNode("div", {
@@ -9516,11 +9530,11 @@ var Vc = (function (exports, vue) {
9516
9530
  }, null) : vue.createVNode(Icon, {
9517
9531
  "type": props2.mode,
9518
9532
  "class": [`is-${props2.mode}`, "vc-message__icon"]
9519
- }, null), typeof props2.content === "string" ? vue.createVNode("div", {
9533
+ }, null), typeof currentContent.value === "string" ? vue.createVNode("div", {
9520
9534
  "class": "vc-message__content",
9521
- "innerHTML": props2.content
9522
- }, null) : typeof props2.content === "function" ? vue.createVNode(Customer, {
9523
- "render": props2.content
9535
+ "innerHTML": currentContent.value
9536
+ }, null) : typeof currentContent.value === "function" ? vue.createVNode(Customer, {
9537
+ "render": currentContent.value
9524
9538
  }, null) : null, props2.closable && vue.createVNode(Icon, {
9525
9539
  "type": "close",
9526
9540
  "class": "vc-message__close",
@@ -10175,9 +10189,10 @@ var Vc = (function (exports, vue) {
10175
10189
  const props$z = {
10176
10190
  title: [String, Function],
10177
10191
  content: [String, Function],
10192
+ // 单位ms
10178
10193
  duration: {
10179
10194
  type: Number,
10180
- default: 450
10195
+ default: 4500
10181
10196
  },
10182
10197
  closable: {
10183
10198
  type: Boolean,
@@ -10208,13 +10223,25 @@ var Vc = (function (exports, vue) {
10208
10223
  }) {
10209
10224
  const instance = vue.getCurrentInstance();
10210
10225
  const isActive = vue.ref(false);
10226
+ const currentTitle = vue.ref();
10227
+ const currentContent = vue.ref();
10228
+ const setTitle = (v) => {
10229
+ currentTitle.value = v;
10230
+ };
10231
+ const setContent = (v) => {
10232
+ currentContent.value = v;
10233
+ };
10234
+ vue.watch(() => props2.title, setTitle, {
10235
+ immediate: true
10236
+ });
10237
+ vue.watch(() => props2.content, setContent, {
10238
+ immediate: true
10239
+ });
10211
10240
  let timer;
10212
10241
  vue.onMounted(() => {
10213
10242
  isActive.value = true;
10214
10243
  if (props2.duration !== 0) {
10215
- timer = setTimeout(() => {
10216
- isActive.value = false;
10217
- }, props2.duration * 1e3 - 300);
10244
+ timer = setTimeout(() => isActive.value = false, props2.duration);
10218
10245
  }
10219
10246
  });
10220
10247
  vue.onUnmounted(() => {
@@ -10257,21 +10284,21 @@ var Vc = (function (exports, vue) {
10257
10284
  }, [props2.mode && vue.createVNode(Icon, {
10258
10285
  "type": `o-${props2.mode}`,
10259
10286
  "class": [`is-${props2.mode}`, "vc-notice__icon"]
10260
- }, null), vue.createVNode("div", null, [props2.title && vue.createVNode("div", {
10287
+ }, null), vue.createVNode("div", null, [currentTitle.value && vue.createVNode("div", {
10261
10288
  "style": [{
10262
- marginBottom: props2.content ? "8px" : ""
10289
+ marginBottom: currentContent.value ? "8px" : ""
10263
10290
  }],
10264
10291
  "class": "vc-notice__title"
10265
- }, [typeof props2.title === "string" ? vue.createVNode("div", {
10266
- "innerHTML": props2.title
10267
- }, null) : typeof props2.title === "function" ? vue.createVNode(Customer, {
10268
- "render": props2.title
10269
- }, null) : null]), props2.content && vue.createVNode("div", {
10292
+ }, [typeof currentTitle.value === "string" ? vue.createVNode("div", {
10293
+ "innerHTML": currentTitle.value
10294
+ }, null) : typeof currentTitle.value === "function" ? vue.createVNode(Customer, {
10295
+ "render": currentTitle.value
10296
+ }, null) : null]), currentContent.value && vue.createVNode("div", {
10270
10297
  "class": "vc-notice__content"
10271
- }, [typeof props2.content === "string" ? vue.createVNode("div", {
10272
- "innerHTML": props2.content
10273
- }, null) : typeof props2.content === "function" ? vue.createVNode(Customer, {
10274
- "render": props2.content
10298
+ }, [typeof currentContent.value === "string" ? vue.createVNode("div", {
10299
+ "innerHTML": currentContent.value
10300
+ }, null) : typeof currentContent.value === "function" ? vue.createVNode(Customer, {
10301
+ "render": currentContent.value
10275
10302
  }, null) : null])]), props2.closable && vue.createVNode(Icon, {
10276
10303
  "type": "close",
10277
10304
  "style": "font-size: 12px",
@@ -7487,6 +7487,7 @@
7487
7487
  type: Boolean,
7488
7488
  default: true
7489
7489
  },
7490
+ // 单位ms
7490
7491
  duration: {
7491
7492
  type: Number,
7492
7493
  default: 3e3
@@ -7513,23 +7514,28 @@
7513
7514
  emit,
7514
7515
  expose
7515
7516
  }) {
7516
- const isVisible = vue.ref(false);
7517
+ const isActive = vue.ref(false);
7518
+ const currentContent = vue.ref();
7519
+ const setContent = (v) => {
7520
+ currentContent.value = v;
7521
+ };
7517
7522
  const handleRemove = () => {
7518
7523
  emit("close");
7519
7524
  emit("portal-fulfilled");
7520
7525
  };
7521
7526
  const handleClose = () => {
7522
7527
  if (props2.maskClosable) {
7523
- isVisible.value = false;
7528
+ isActive.value = false;
7524
7529
  }
7525
7530
  };
7531
+ vue.watch(() => props2.content, setContent, {
7532
+ immediate: true
7533
+ });
7526
7534
  let timer;
7527
7535
  vue.onMounted(() => {
7528
- isVisible.value = true;
7536
+ isActive.value = true;
7529
7537
  if (props2.duration !== 0) {
7530
- timer = setTimeout(() => {
7531
- isVisible.value = false;
7532
- }, props2.duration - 300);
7538
+ timer = setTimeout(() => isActive.value = false, props2.duration);
7533
7539
  }
7534
7540
  });
7535
7541
  vue.onUnmounted(() => {
@@ -7559,12 +7565,12 @@
7559
7565
  "class": "vcm-toast__wrapper"
7560
7566
  }, [props2.mode === "loading" && vue.createVNode(MSpin, {
7561
7567
  "class": "vcm-toast__loading"
7562
- }, null), typeof props2.content === "string" ? vue.createVNode("div", {
7568
+ }, null), typeof currentContent.value === "string" ? vue.createVNode("div", {
7563
7569
  "class": "vcm-toast__content",
7564
- "innerHTML": props2.content
7565
- }, null) : typeof props2.content === "function" ? vue.createVNode(MCustomer, {
7566
- "render": props2.content
7567
- }, null) : null]), [[vue.vShow, isVisible.value]])]
7570
+ "innerHTML": currentContent.value
7571
+ }, null) : typeof currentContent.value === "function" ? vue.createVNode(MCustomer, {
7572
+ "render": currentContent.value
7573
+ }, null) : null]), [[vue.vShow, isActive.value]])]
7568
7574
  })]);
7569
7575
  };
7570
7576
  }
@@ -9428,6 +9434,7 @@
9428
9434
  type: Boolean,
9429
9435
  default: true
9430
9436
  },
9437
+ // 单位ms
9431
9438
  duration: {
9432
9439
  type: Number,
9433
9440
  default: 1500
@@ -9459,6 +9466,10 @@
9459
9466
  }) {
9460
9467
  const instance = vue.getCurrentInstance();
9461
9468
  const isActive = vue.ref(false);
9469
+ const currentContent = vue.ref();
9470
+ const setContent = (v) => {
9471
+ currentContent.value = v;
9472
+ };
9462
9473
  const handleRemove = () => {
9463
9474
  emit("close");
9464
9475
  emit("portal-fulfilled");
@@ -9477,13 +9488,14 @@
9477
9488
  isActive.value = false;
9478
9489
  }
9479
9490
  };
9491
+ vue.watch(() => props2.content, setContent, {
9492
+ immediate: true
9493
+ });
9480
9494
  let timer;
9481
9495
  vue.onMounted(() => {
9482
9496
  isActive.value = true;
9483
9497
  if (props2.duration !== 0) {
9484
- timer = setTimeout(() => {
9485
- isActive.value = false;
9486
- }, props2.duration * 1e3 - 300);
9498
+ timer = setTimeout(() => isActive.value = false, props2.duration);
9487
9499
  }
9488
9500
  });
9489
9501
  vue.onUnmounted(() => {
@@ -9492,7 +9504,9 @@
9492
9504
  const exposes = ["destroy", "remove", "close", "hide"].reduce((pre, key) => {
9493
9505
  pre[key] = handleRemove;
9494
9506
  return pre;
9495
- }, {});
9507
+ }, {
9508
+ setContent
9509
+ });
9496
9510
  expose(exposes);
9497
9511
  return () => {
9498
9512
  return vue.createVNode("div", {
@@ -9519,11 +9533,11 @@
9519
9533
  }, null) : vue.createVNode(Icon, {
9520
9534
  "type": props2.mode,
9521
9535
  "class": [`is-${props2.mode}`, "vc-message__icon"]
9522
- }, null), typeof props2.content === "string" ? vue.createVNode("div", {
9536
+ }, null), typeof currentContent.value === "string" ? vue.createVNode("div", {
9523
9537
  "class": "vc-message__content",
9524
- "innerHTML": props2.content
9525
- }, null) : typeof props2.content === "function" ? vue.createVNode(Customer, {
9526
- "render": props2.content
9538
+ "innerHTML": currentContent.value
9539
+ }, null) : typeof currentContent.value === "function" ? vue.createVNode(Customer, {
9540
+ "render": currentContent.value
9527
9541
  }, null) : null, props2.closable && vue.createVNode(Icon, {
9528
9542
  "type": "close",
9529
9543
  "class": "vc-message__close",
@@ -10178,9 +10192,10 @@
10178
10192
  const props$z = {
10179
10193
  title: [String, Function],
10180
10194
  content: [String, Function],
10195
+ // 单位ms
10181
10196
  duration: {
10182
10197
  type: Number,
10183
- default: 450
10198
+ default: 4500
10184
10199
  },
10185
10200
  closable: {
10186
10201
  type: Boolean,
@@ -10211,13 +10226,25 @@
10211
10226
  }) {
10212
10227
  const instance = vue.getCurrentInstance();
10213
10228
  const isActive = vue.ref(false);
10229
+ const currentTitle = vue.ref();
10230
+ const currentContent = vue.ref();
10231
+ const setTitle = (v) => {
10232
+ currentTitle.value = v;
10233
+ };
10234
+ const setContent = (v) => {
10235
+ currentContent.value = v;
10236
+ };
10237
+ vue.watch(() => props2.title, setTitle, {
10238
+ immediate: true
10239
+ });
10240
+ vue.watch(() => props2.content, setContent, {
10241
+ immediate: true
10242
+ });
10214
10243
  let timer;
10215
10244
  vue.onMounted(() => {
10216
10245
  isActive.value = true;
10217
10246
  if (props2.duration !== 0) {
10218
- timer = setTimeout(() => {
10219
- isActive.value = false;
10220
- }, props2.duration * 1e3 - 300);
10247
+ timer = setTimeout(() => isActive.value = false, props2.duration);
10221
10248
  }
10222
10249
  });
10223
10250
  vue.onUnmounted(() => {
@@ -10260,21 +10287,21 @@
10260
10287
  }, [props2.mode && vue.createVNode(Icon, {
10261
10288
  "type": `o-${props2.mode}`,
10262
10289
  "class": [`is-${props2.mode}`, "vc-notice__icon"]
10263
- }, null), vue.createVNode("div", null, [props2.title && vue.createVNode("div", {
10290
+ }, null), vue.createVNode("div", null, [currentTitle.value && vue.createVNode("div", {
10264
10291
  "style": [{
10265
- marginBottom: props2.content ? "8px" : ""
10292
+ marginBottom: currentContent.value ? "8px" : ""
10266
10293
  }],
10267
10294
  "class": "vc-notice__title"
10268
- }, [typeof props2.title === "string" ? vue.createVNode("div", {
10269
- "innerHTML": props2.title
10270
- }, null) : typeof props2.title === "function" ? vue.createVNode(Customer, {
10271
- "render": props2.title
10272
- }, null) : null]), props2.content && vue.createVNode("div", {
10295
+ }, [typeof currentTitle.value === "string" ? vue.createVNode("div", {
10296
+ "innerHTML": currentTitle.value
10297
+ }, null) : typeof currentTitle.value === "function" ? vue.createVNode(Customer, {
10298
+ "render": currentTitle.value
10299
+ }, null) : null]), currentContent.value && vue.createVNode("div", {
10273
10300
  "class": "vc-notice__content"
10274
- }, [typeof props2.content === "string" ? vue.createVNode("div", {
10275
- "innerHTML": props2.content
10276
- }, null) : typeof props2.content === "function" ? vue.createVNode(Customer, {
10277
- "render": props2.content
10301
+ }, [typeof currentContent.value === "string" ? vue.createVNode("div", {
10302
+ "innerHTML": currentContent.value
10303
+ }, null) : typeof currentContent.value === "function" ? vue.createVNode(Customer, {
10304
+ "render": currentContent.value
10278
10305
  }, null) : null])]), props2.closable && vue.createVNode(Icon, {
10279
10306
  "type": "close",
10280
10307
  "style": "font-size: 12px",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deot/vc",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -19,9 +19,9 @@
19
19
  "access": "public"
20
20
  },
21
21
  "dependencies": {
22
- "@deot/vc-components": "^1.0.5",
23
- "@deot/vc-hooks": "^1.0.5",
24
- "@deot/vc-shared": "^1.0.5"
22
+ "@deot/vc-components": "^1.0.6",
23
+ "@deot/vc-hooks": "^1.0.6",
24
+ "@deot/vc-shared": "^1.0.6"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "vue": "*"