小程序端工程代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
374 B

  1. <template>
  2. <text>{{time}}</text>
  3. </template>
  4. <script>
  5. import { dataFormat } from "@/utils";
  6. export default {
  7. name: "DataFormat",
  8. props: ["date"],
  9. data: function() {
  10. return {
  11. time: ""
  12. };
  13. },
  14. mounted() {
  15. this.time = dataFormat(this.date);
  16. },
  17. watch: {
  18. "$props.date"(props) {
  19. this.time = dataFormat(this.date);
  20. }
  21. }
  22. };
  23. </script>