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