mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-02 03:57:52 +00:00
refactor: show deprecation warnings in dev only (#10868)
Fixes: https://github.com/chatwoot/chatwoot/issues/10734
This commit is contained in:
@@ -57,7 +57,7 @@ useEventListener(document.body, 'mouseup', onMouseUp);
|
|||||||
useEventListener(document, 'keydown', onKeydown);
|
useEventListener(document, 'keydown', onKeydown);
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (onClose && typeof onClose === 'function') {
|
if (import.meta.env.DEV && onClose && typeof onClose === 'function') {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.warn(
|
console.warn(
|
||||||
"[DEPRECATED] The 'onClose' prop is deprecated. Please use the 'close' event instead."
|
"[DEPRECATED] The 'onClose' prop is deprecated. Please use the 'close' event instead."
|
||||||
|
|||||||
@@ -28,10 +28,12 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
// eslint-disable-next-line
|
if (import.meta.env.DEV) {
|
||||||
console.warn(
|
// eslint-disable-next-line
|
||||||
'[DEPRECATED] This component has been deprecated and will be removed soon. Please use v3/components/Form/Button.vue instead'
|
console.warn(
|
||||||
);
|
'[DEPRECATED] This component has been deprecated and will be removed soon. Please use v3/components/Form/Button.vue instead'
|
||||||
|
);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -40,10 +40,12 @@ export default {
|
|||||||
},
|
},
|
||||||
emits: ['update:modelValue', 'input', 'blur'],
|
emits: ['update:modelValue', 'input', 'blur'],
|
||||||
mounted() {
|
mounted() {
|
||||||
// eslint-disable-next-line
|
if (import.meta.env.DEV) {
|
||||||
console.warn(
|
// eslint-disable-next-line no-console
|
||||||
'[DEPRECATED] <WootInput> has be deprecated and will be removed soon. Please use v3/components/Form/Input.vue instead'
|
console.warn(
|
||||||
);
|
'[DEPRECATED] <WootInput> has be deprecated and will be removed soon. Please use v3/components/Form/Input.vue instead'
|
||||||
|
);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onChange(e) {
|
onChange(e) {
|
||||||
|
|||||||
@@ -40,10 +40,12 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
// eslint-disable-next-line
|
if (import.meta.env.DEV) {
|
||||||
console.warn(
|
// eslint-disable-next-line
|
||||||
'[DEPRECATED] This component has been deprecated and will be removed soon. Please use v3/components/Form/Button.vue instead'
|
console.warn(
|
||||||
);
|
'[DEPRECATED] This component has been deprecated and will be removed soon. Please use v3/components/Form/Button.vue instead'
|
||||||
|
);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user