增加基本项目配置
This commit is contained in:
24
components/DataFormat.vue
Normal file
24
components/DataFormat.vue
Normal file
@ -0,0 +1,24 @@
|
||||
<template>
|
||||
<span>{{time}}</span>
|
||||
</template>
|
||||
<script>
|
||||
import { dataFormat } from "@/utils";
|
||||
|
||||
export default {
|
||||
name: "DataFormat",
|
||||
props: ["data"],
|
||||
data: function() {
|
||||
return {
|
||||
time: ""
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.time = dataFormat(this.data);
|
||||
},
|
||||
watch: {
|
||||
"$props.data"(props) {
|
||||
this.time = dataFormat(this.data);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Reference in New Issue
Block a user