@fecp/mobile 1.0.8 → 1.0.9

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.
@@ -52,6 +52,9 @@ const _sfc_main = {
52
52
  const emit = __emit;
53
53
  const defaultDate = computed({
54
54
  get: () => {
55
+ if (!props.modelValue) {
56
+ return null;
57
+ }
55
58
  if (props.calendarType == "single") {
56
59
  try {
57
60
  return hooks(props.modelValue, props.valueFormat).toDate();
@@ -83,6 +86,9 @@ const _sfc_main = {
83
86
  watch(
84
87
  () => props.modelValue,
85
88
  (value) => {
89
+ if (!value) {
90
+ return;
91
+ }
86
92
  if (props.calendarType == "single") {
87
93
  fieldTextValue.value = hooks(value, props.valueFormat).format(
88
94
  props.textFormat
@@ -41,6 +41,10 @@ const _sfc_main = {
41
41
  const showPicker = ref(false);
42
42
  const emit = __emit;
43
43
  const pickerValue = computed(() => {
44
+ if (!props.modelValue) {
45
+ const date2 = hooks();
46
+ return [date2.year(), date2.month() + 1, date2.date()];
47
+ }
44
48
  const date = hooks(props.modelValue, props.valueFormat);
45
49
  const value = [date.year(), date.month() + 1, date.date()];
46
50
  return value;
@@ -48,6 +52,9 @@ const _sfc_main = {
48
52
  watch(
49
53
  () => props.modelValue,
50
54
  (value) => {
55
+ if (!value) {
56
+ return;
57
+ }
51
58
  fieldTextValue.value = hooks(value, props.valueFormat).format(
52
59
  props.textFormat
53
60
  );
@@ -54,6 +54,9 @@ const _sfc_main = {
54
54
  watch(
55
55
  () => props.modelValue,
56
56
  (value) => {
57
+ if (!value) {
58
+ return;
59
+ }
57
60
  const optionItem = props.columns.find(
58
61
  (item) => item[props.columnsFieldNames.value] == value
59
62
  );
@@ -41,6 +41,10 @@ const _sfc_main = {
41
41
  const showPicker = ref(false);
42
42
  const emit = __emit;
43
43
  const pickerValue = computed(() => {
44
+ if (!props.modelValue) {
45
+ const date2 = hooks();
46
+ return [date2.hours(), date2.minutes(), date2.seconds()];
47
+ }
44
48
  const date = hooks(props.modelValue, props.valueFormat);
45
49
  const value = [date.hours(), date.minutes(), date.seconds()];
46
50
  return value;
@@ -48,6 +52,9 @@ const _sfc_main = {
48
52
  watch(
49
53
  () => props.modelValue,
50
54
  (value) => {
55
+ if (!value) {
56
+ return;
57
+ }
51
58
  fieldTextValue.value = hooks(value, props.valueFormat).format(
52
59
  props.textFormat
53
60
  );
@@ -54,6 +54,9 @@ const _sfc_main = {
54
54
  const emit = __emit;
55
55
  const defaultDate = vue.computed({
56
56
  get: () => {
57
+ if (!props.modelValue) {
58
+ return null;
59
+ }
57
60
  if (props.calendarType == "single") {
58
61
  try {
59
62
  return moment.default(props.modelValue, props.valueFormat).toDate();
@@ -85,6 +88,9 @@ const _sfc_main = {
85
88
  vue.watch(
86
89
  () => props.modelValue,
87
90
  (value) => {
91
+ if (!value) {
92
+ return;
93
+ }
88
94
  if (props.calendarType == "single") {
89
95
  fieldTextValue.value = moment.default(value, props.valueFormat).format(
90
96
  props.textFormat
@@ -43,6 +43,10 @@ const _sfc_main = {
43
43
  const showPicker = vue.ref(false);
44
44
  const emit = __emit;
45
45
  const pickerValue = vue.computed(() => {
46
+ if (!props.modelValue) {
47
+ const date2 = moment.default();
48
+ return [date2.year(), date2.month() + 1, date2.date()];
49
+ }
46
50
  const date = moment.default(props.modelValue, props.valueFormat);
47
51
  const value = [date.year(), date.month() + 1, date.date()];
48
52
  return value;
@@ -50,6 +54,9 @@ const _sfc_main = {
50
54
  vue.watch(
51
55
  () => props.modelValue,
52
56
  (value) => {
57
+ if (!value) {
58
+ return;
59
+ }
53
60
  fieldTextValue.value = moment.default(value, props.valueFormat).format(
54
61
  props.textFormat
55
62
  );
@@ -56,6 +56,9 @@ const _sfc_main = {
56
56
  vue.watch(
57
57
  () => props.modelValue,
58
58
  (value) => {
59
+ if (!value) {
60
+ return;
61
+ }
59
62
  const optionItem = props.columns.find(
60
63
  (item) => item[props.columnsFieldNames.value] == value
61
64
  );
@@ -43,6 +43,10 @@ const _sfc_main = {
43
43
  const showPicker = vue.ref(false);
44
44
  const emit = __emit;
45
45
  const pickerValue = vue.computed(() => {
46
+ if (!props.modelValue) {
47
+ const date2 = moment.default();
48
+ return [date2.hours(), date2.minutes(), date2.seconds()];
49
+ }
46
50
  const date = moment.default(props.modelValue, props.valueFormat);
47
51
  const value = [date.hours(), date.minutes(), date.seconds()];
48
52
  return value;
@@ -50,6 +54,9 @@ const _sfc_main = {
50
54
  vue.watch(
51
55
  () => props.modelValue,
52
56
  (value) => {
57
+ if (!value) {
58
+ return;
59
+ }
53
60
  fieldTextValue.value = moment.default(value, props.valueFormat).format(
54
61
  props.textFormat
55
62
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fecp/mobile",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "main": "lib/packages/mobile/index.js",
5
5
  "module": "es/packages/mobile/index.mjs",
6
6
  "files": [