Closed huangbaihei closed 5 months ago
include the dayjs
library in the global scope
<script src="https://cdn.jsdelivr.net/npm/dayjs@1/dayjs.min.js"></script>
add dayjs
library to the moduleCache
const options = {
moduleCache: {
vue: Vue,
dayjs
},
...
use the dayjs
in your component
<script>
import dayjs from 'dayjs'
alert(dayjs().format())
</script>
request to be reopened as needed
When I use import dayjs from "dayjs", the dayjs I get is not the default export, but the whole module. Dayjs has been put into modulecache