LoginSignup
0
0

More than 1 year has passed since last update.

vue3 で day.js

Posted at

day.js を vue3 で読み込む方法。

app.js

import dayjs from 'dayjs';
import 'dayjs/locale/ja';
dayjs.locale('ja');

const app = createApp({

    data () {
        return {
            dayjs:'',
        }
    },

    created(){
        this.dayjs = dayjs;

hoge.vue

{{this.$root.dayjs().format('YYYY年M月DD日')}}

こんな感じ

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0