fix: $dayJs改为全局引用,去除不必要组件引入
This commit is contained in:
11
src/App.vue
11
src/App.vue
@@ -5,6 +5,17 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { storageKey } from '@/utils/constants'
|
import { storageKey } from '@/utils/constants'
|
||||||
|
const dayjs = require('dayjs')
|
||||||
|
const utc = require('dayjs/plugin/utc')
|
||||||
|
const timezone = require('dayjs/plugin/timezone')
|
||||||
|
const advancedFormat = require('dayjs/plugin/advancedFormat')
|
||||||
|
const weekday = require('dayjs/plugin/weekday')
|
||||||
|
dayjs.extend(utc)
|
||||||
|
dayjs.extend(timezone)
|
||||||
|
dayjs.extend(advancedFormat)
|
||||||
|
dayjs.extend(weekday)
|
||||||
|
window.$dayJs = dayjs
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'App',
|
name: 'App',
|
||||||
setup () {
|
setup () {
|
||||||
|
|||||||
@@ -77,7 +77,6 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { ref, computed } from 'vue'
|
import { ref, computed } from 'vue'
|
||||||
import MyDatePicker from '../MyDatePicker'
|
|
||||||
import { storageKey } from '@/utils/constants'
|
import { storageKey } from '@/utils/constants'
|
||||||
import { getMillisecond, timestampToList } from '@/utils/date-util'
|
import { getMillisecond, timestampToList } from '@/utils/date-util'
|
||||||
import { useStore } from 'vuex'
|
import { useStore } from 'vuex'
|
||||||
@@ -98,9 +97,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
emits: ['change'],
|
emits: ['change'],
|
||||||
components: {
|
|
||||||
MyDatePicker
|
|
||||||
},
|
|
||||||
setup (props, ctx) {
|
setup (props, ctx) {
|
||||||
// data
|
// data
|
||||||
const store = useStore()
|
const store = useStore()
|
||||||
@@ -253,7 +249,6 @@ export default {
|
|||||||
return {
|
return {
|
||||||
myStartTime,
|
myStartTime,
|
||||||
myEndTime,
|
myEndTime,
|
||||||
getMillisecond,
|
|
||||||
dropdownFlag,
|
dropdownFlag,
|
||||||
utcStr,
|
utcStr,
|
||||||
address,
|
address,
|
||||||
@@ -265,6 +260,7 @@ export default {
|
|||||||
showDetail,
|
showDetail,
|
||||||
rangeHistory,
|
rangeHistory,
|
||||||
rangeHistoryArr,
|
rangeHistoryArr,
|
||||||
|
getMillisecond,
|
||||||
myDatePickerShow,
|
myDatePickerShow,
|
||||||
showDropdown,
|
showDropdown,
|
||||||
changeDropdown,
|
changeDropdown,
|
||||||
|
|||||||
@@ -26,12 +26,6 @@ const emitter = new bus()
|
|||||||
|
|
||||||
const _ = require('lodash') // lodash工具
|
const _ = require('lodash') // lodash工具
|
||||||
|
|
||||||
/* dayjs.extend(utc)
|
|
||||||
dayjs.extend(timezone)
|
|
||||||
dayjs.extend(advancedFormat)
|
|
||||||
dayjs.extend(weekday)
|
|
||||||
window.$dayJs = dayjs */
|
|
||||||
|
|
||||||
const app = createApp(App)
|
const app = createApp(App)
|
||||||
|
|
||||||
app.use(router)
|
app.use(router)
|
||||||
|
|||||||
Reference in New Issue
Block a user