diff --git a/package.json b/package.json index bf8bcf8..7c22e3f 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "less": "4.1.3", "mobile-select": "1.1.2", "unplugin-vue-macros": "^2.7.10", + "unplugin-vue-define-options": "^1.4.1", "vite": "4.5.2" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 24b6498..df6b396 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -79,6 +79,9 @@ devDependencies: mobile-select: specifier: 1.1.2 version: 1.1.2 + unplugin-vue-define-options: + specifier: ^1.4.1 + version: 1.4.2(vue@3.4.21) unplugin-vue-macros: specifier: ^2.7.10 version: 2.7.10(vite@4.5.2)(vue@3.4.21) @@ -1509,6 +1512,15 @@ packages: resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} engines: {node: '>=0.12'} + /errno@0.1.8: + resolution: {integrity: sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==} + hasBin: true + requiresBuild: true + dependencies: + prr: 1.0.1 + dev: true + optional: true + /esbuild@0.18.20: resolution: {integrity: sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==} engines: {node: '>=12'} @@ -1709,6 +1721,14 @@ packages: dev: true optional: true + /image-size@0.5.5: + resolution: {integrity: sha512-6TDAlDPZxUFCv+fuOkIoXT/V/f3Qbq8e37p+YOiYrUv3v9cc3/6x78VdfPgFVaB9dZYeLUfKgHRebpkm/oP2VQ==} + engines: {node: '>=0.10.0'} + hasBin: true + requiresBuild: true + dev: true + optional: true + /imagesloaded@4.1.4: resolution: {integrity: sha512-ltiBVcYpc/TYTF5nolkMNsnREHW+ICvfQ3Yla2Sgr71YFwQ86bDwV9hgpFhFtrGPuwEx5+LqOHIrdXBdoWwwsA==} dependencies: @@ -1798,13 +1818,13 @@ packages: parse-node-version: 1.0.1 tslib: 2.6.2 optionalDependencies: - errno: r2.cnpmjs.org/errno@0.1.8 + errno: 0.1.8 graceful-fs: 4.2.11 - image-size: r2.cnpmjs.org/image-size@0.5.5 - make-dir: r2.cnpmjs.org/make-dir@2.1.0 - mime: r2.cnpmjs.org/mime@1.6.0 + image-size: 0.5.5 + make-dir: 2.1.0 + mime: 1.6.0 needle: 3.2.0 - source-map: r2.cnpmjs.org/source-map@0.6.1 + source-map: 0.6.1 transitivePeerDependencies: - supports-color dev: true @@ -1853,6 +1873,16 @@ packages: dependencies: '@jridgewell/sourcemap-codec': 1.4.15 + /make-dir@2.1.0: + resolution: {integrity: sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==} + engines: {node: '>=6'} + requiresBuild: true + dependencies: + pify: 4.0.1 + semver: 5.7.2 + dev: true + optional: true + /make-dir@3.1.0: resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} engines: {node: '>=8'} @@ -1881,6 +1911,14 @@ packages: mime-db: 1.52.0 dev: false + /mime@1.6.0: + resolution: {integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==} + engines: {node: '>=4'} + hasBin: true + requiresBuild: true + dev: true + optional: true + /minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} requiresBuild: true @@ -2014,6 +2052,19 @@ packages: resolution: {integrity: sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==} dev: true + /nodejieba@2.5.2: + resolution: {integrity: sha512-ByskJvaBrQ2eV+5M0OeD80S5NKoGaHc9zi3Z/PTKl/95eac2YF8RmWduq9AknLpkQLrLAIcqurrtC6BzjpKwwg==} + engines: {node: '>= 10.20.0'} + requiresBuild: true + dependencies: + '@mapbox/node-pre-gyp': 1.0.11 + node-addon-api: 3.2.1 + transitivePeerDependencies: + - encoding + - supports-color + dev: false + optional: true + /nopt@5.0.0: resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} engines: {node: '>=6'} @@ -2116,7 +2167,7 @@ packages: commander: 1.1.1 object-assign: 4.1.1 optionalDependencies: - nodejieba: r2.cnpmjs.org/nodejieba@2.5.2 + nodejieba: 2.5.2 transitivePeerDependencies: - encoding - supports-color @@ -2268,7 +2319,7 @@ packages: /source-map@0.6.1: resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} engines: {node: '>=0.10.0'} - dev: false + requiresBuild: true /ssr-window@4.0.2: resolution: {integrity: sha512-ISv/Ch+ig7SOtw7G2+qkwfVASzazUnvlDTwypdLoPoySv+6MqlOV10VwPSE6EWkGjhW50lUmghPmpYZXMu/+AQ==} @@ -2655,70 +2706,3 @@ packages: requiresBuild: true dev: false optional: true - - r2.cnpmjs.org/errno@0.1.8: - resolution: {integrity: sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==, registry: https://r.cnpmjs.org/, tarball: https://r2.cnpmjs.org/errno/-/errno-0.1.8.tgz} - name: errno - version: 0.1.8 - hasBin: true - requiresBuild: true - dependencies: - prr: 1.0.1 - dev: true - optional: true - - r2.cnpmjs.org/image-size@0.5.5: - resolution: {integrity: sha512-6TDAlDPZxUFCv+fuOkIoXT/V/f3Qbq8e37p+YOiYrUv3v9cc3/6x78VdfPgFVaB9dZYeLUfKgHRebpkm/oP2VQ==, registry: https://r.cnpmjs.org/, tarball: https://r2.cnpmjs.org/image-size/-/image-size-0.5.5.tgz} - name: image-size - version: 0.5.5 - engines: {node: '>=0.10.0'} - hasBin: true - requiresBuild: true - dev: true - optional: true - - r2.cnpmjs.org/make-dir@2.1.0: - resolution: {integrity: sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==, registry: https://r.cnpmjs.org/, tarball: https://r2.cnpmjs.org/make-dir/-/make-dir-2.1.0.tgz} - name: make-dir - version: 2.1.0 - engines: {node: '>=6'} - requiresBuild: true - dependencies: - pify: 4.0.1 - semver: 5.7.2 - dev: true - optional: true - - r2.cnpmjs.org/mime@1.6.0: - resolution: {integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==, registry: https://r.cnpmjs.org/, tarball: https://r2.cnpmjs.org/mime/-/mime-1.6.0.tgz} - name: mime - version: 1.6.0 - engines: {node: '>=4'} - hasBin: true - requiresBuild: true - dev: true - optional: true - - r2.cnpmjs.org/nodejieba@2.5.2: - resolution: {integrity: sha512-ByskJvaBrQ2eV+5M0OeD80S5NKoGaHc9zi3Z/PTKl/95eac2YF8RmWduq9AknLpkQLrLAIcqurrtC6BzjpKwwg==, registry: https://r.cnpmjs.org/, tarball: https://r2.cnpmjs.org/nodejieba/-/nodejieba-2.5.2.tgz} - name: nodejieba - version: 2.5.2 - engines: {node: '>= 10.20.0'} - requiresBuild: true - dependencies: - '@mapbox/node-pre-gyp': 1.0.11 - node-addon-api: 3.2.1 - transitivePeerDependencies: - - encoding - - supports-color - dev: false - optional: true - - r2.cnpmjs.org/source-map@0.6.1: - resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==, registry: https://r.cnpmjs.org/, tarball: https://r2.cnpmjs.org/source-map/-/source-map-0.6.1.tgz} - name: source-map - version: 0.6.1 - engines: {node: '>=0.10.0'} - requiresBuild: true - dev: true - optional: true diff --git a/src/components/BaseMarquee.vue b/src/components/BaseMarquee.vue deleted file mode 100644 index 7ecbb05..0000000 --- a/src/components/BaseMarquee.vue +++ /dev/null @@ -1,104 +0,0 @@ - - - - diff --git a/src/components/Posters.vue b/src/components/Posters.vue index 89b6f9a..d7cf551 100644 --- a/src/components/Posters.vue +++ b/src/components/Posters.vue @@ -1,11 +1,11 @@ - diff --git a/src/components/UserPanel.vue b/src/components/UserPanel.vue index 990b3c6..6433ba9 100644 --- a/src/components/UserPanel.vue +++ b/src/components/UserPanel.vue @@ -96,94 +96,96 @@ - +
+ 作品 {{ props.currentItem.author.aweme_count }} + +
+
+ + +
diff --git a/src/components/Video.vue b/src/components/Video.vue index 8278b47..0f42e42 100644 --- a/src/components/Video.vue +++ b/src/components/Video.vue @@ -70,11 +70,6 @@
-
@@ -117,16 +112,13 @@ - - diff --git a/src/components/slide/UNUSE_SlideColumnVirtualList.txt b/src/components/slide/UNUSE_SlideColumnVirtualList.txt deleted file mode 100644 index 7426086..0000000 --- a/src/components/slide/UNUSE_SlideColumnVirtualList.txt +++ /dev/null @@ -1,322 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/components/slide/VInfinite-Component.vue b/src/components/slide/VInfinite-Component.vue deleted file mode 100644 index f98d01b..0000000 --- a/src/components/slide/VInfinite-Component.vue +++ /dev/null @@ -1,184 +0,0 @@ - - - - -测试用 \ No newline at end of file diff --git a/src/pages/test/Test.vue b/src/pages/test/Test.vue index 6ac1b59..1c04374 100644 --- a/src/pages/test/Test.vue +++ b/src/pages/test/Test.vue @@ -1,46 +1,14 @@ - - - - \ No newline at end of file diff --git a/src/pages/test/TestSlide.vue b/src/pages/test/TestSlide.vue deleted file mode 100644 index e3d04e6..0000000 --- a/src/pages/test/TestSlide.vue +++ /dev/null @@ -1,404 +0,0 @@ - - - - - diff --git a/src/pages/test/TestSwiperJs.vue b/src/pages/test/TestSwiperJs.vue deleted file mode 100644 index e09a12a..0000000 --- a/src/pages/test/TestSwiperJs.vue +++ /dev/null @@ -1,111 +0,0 @@ - - - \ No newline at end of file diff --git a/src/pages/test/slide.jsx b/src/pages/test/slide.jsx deleted file mode 100644 index 7673ac5..0000000 --- a/src/pages/test/slide.jsx +++ /dev/null @@ -1,278 +0,0 @@ -import Dom from "../../utils/dom"; -import * as Vue from "vue"; - -export default class Slide { - - constructor(id, config = {index: 0}) { - this.slideList = this.create('
') - this.slideList.addEventListener('touchstart', this.touchstart.bind(this)) - this.slideList.addEventListener('touchmove', this.touchmove.bind(this)) - this.slideList.addEventListener('touchend', this.touchend.bind(this)) - - let container = new Dom(id) - // container.css('height','100%') - container.css('width', '100%') - container.css('overflow', 'hidden') - container.append(new Dom(this.slideList)) - this.total = 0 - this.pageSize = 10 - this.pageNo = 0 - this.list = [] - this.index = config.index || 0 - this.listMap = new Map() - this.loading = false - - - this.judgeValue = 0 - this.startTime = 0 - this.startLocationX = 0 - this.startLocationY = 0 - this.moveXDistance = 0 - this.moveYDistance = 0 - this.virtualTotal = 5 - - this.height = parseFloat(container.css('height')) - // console.log('height',this.height) - this.isDrawDown = true - this.config = config - this.appInsMap = new Map() - - - this.isRecommend = !(this.config.list && this.config.list.length); - - this.getData(this.pageNo) - } - - async getData(pageNo, init = true) { - if (this.isRecommend) { - this.getRecommend(pageNo).then(r => { - init && this.init() - }) - } else { - if (init) { - this.total = this.config.list.length - for (let i = 0; i < this.config.list.length / this.virtualTotal; i++) { - this.listMap.set(i, this.config.list.slice(i * this.virtualTotal, (i + 1) * this.virtualTotal)) - } - this.init() - } - } - } - - async getRecommend(pageNo) { - // if (pageNo === 1) return - if (this.config.request) { - if (this.listMap.has(pageNo)) return - this.loading = true - let res = await this.config.request({pageNo, pageSize: this.pageSize}) - this.loading = true - if (res.code === 200) { - this.total = res.data.total - this.pageNo = pageNo - // console.log('请求数据', res.data.list) - this.listMap.set(pageNo, res.data.list) - // this.list = this.list.concat(res.data.list) - } - } - } - - init() { - //计算出正确的开始下标和结束下标 - // 情况一,数据是推荐的,默认取前面virtualTotal(5)条 - // 情况二,数据是固定的,当前要播放的视频在中间,那么取前2,后2 - // 情况二,数据是固定的,当前要播放的视频在后面,那么往前取,直到5条 - let start = 0 - let end = start + this.virtualTotal - if (this.total > this.virtualTotal) { - if (this.index > 1) start = this.index - 2 - end = start + this.virtualTotal - if (end > this.total) { - start = start - (end - this.total) - } - } - // console.log('startIndex', start) - // console.log('endIndex', end) - this.getList().slice(start, end).map((v, i) => { - let el = this.getInsEl(v, start + i, this.index === start + i) - this.slideList.appendChild(el) - }) - - //this.total > this.virtualTotal,只有总条数在不少this.virtualTotal条数的情况下用top - //this.index > 1 和setTop保持统一,这里其实可以用this.index > 2 - // if (this.index > 1 && this.total > this.virtualTotal) { - if (this.index > 1) { - this.css(this.slideList, 'transform', `translate3d(0px, ${this.getHeight()}px, 0px)`) - - this.slideList.childNodes.forEach(v => { - //(this.total - 1 - this.index) > 1 ? 0 : this.total - 1 - this.index) , 如果当前是最后两条,那么要多减去N个height - console.log('((this.total - 1 - this.index) > 1 ? 0 : this.total - 1 - this.index)', - (this.total - 1 - this.index) > 1 ? 0 : this.total - 1 - this.index) - this.css(v, 'top', (this.index - 2 - ((this.total - 1 - this.index) > 1 ? 0 : this.total - 1 - this.index)) * this.height + 'px') - }) - } - // this.setTop() - this.setActive() - } - - getInsEl(item, index, play = false) { - // console.log('index',index,play) - let slideVNode = this.config.render(item, index, play) - const app = Vue.createApp({ - render() { - return
{slideVNode}
- } - }) - const ins = app.mount(document.createElement('div')) - this.appInsMap.set(index, app) - - return ins.$el - } - - touchstart(e) { - // console.log('start') - this.startLocationX = e.touches[0].pageX - this.startLocationY = e.touches[0].pageY - this.moveXDistance = 0 - this.moveYDistance = 0 - - this.startTime = Date.now() - // console.log('touchstart', this.startTime) - this.css(this.slideList, 'transition-duration', '0ms') - } - - touchmove(e) { - // console.log('move') - this.moveXDistance = e.touches[0].pageX - this.startLocationX - this.moveYDistance = e.touches[0].pageY - this.startLocationY - // console.log('touchmove', this.moveXDistance) - // console.log('touchmove', this.moveYDistance) - this.isDrawDown = this.moveYDistance < 0 - // console.log('isDrawDown', this.isDrawDown) - if (this.isDrawDown) { - if (this.index === this.getList().length - 1) { - this.css(this.slideList, 'transform', `translate3d(0px, ${this.getHeight() + (Math.abs(this.moveYDistance) > this.height / 5 ? -this.height / 5 : this.moveYDistance)}px, 0px)`) - return - } - } else { - if (this.index === 0) return - } - - this.css(this.slideList, 'transform', `translate3d(0px, ${this.getHeight() + this.moveYDistance + (this.isDrawDown ? this.judgeValue : -this.judgeValue)}px, 0px)`) - } - - touchend() { - // console.log('end') - //如果向下划,并且加载中,并且还是已有数据的最后一条 - if (this.isDrawDown && this.loading && this.index === this.getList().length - 1) { - return console.log('加载中') - } - - let canSlide = this.height / 8 < Math.abs(this.moveYDistance) && Math.abs(this.moveYDistance) > 40; - if (Date.now() - this.startTime < 40) canSlide = false - - if (canSlide) { - let stopPreviousNodeFn = (index) => { - setTimeout(() => { - let previousNode = this.slideList.querySelector(`.slide-item-${index} .video-wrapper`) - previousNode && previousNode.dispatchEvent(new Event('stop')) - }, 300) - } - //index要传过去,不然是修改后的值 - stopPreviousNodeFn(this.index) - - if (this.isDrawDown) { - if (this.index < this.getList().length - 1) { - this.index += 1 - } - if (this.index < this.total - 2) { - let addIndex = this.index + 2 - let removeIndex = this.index - 3 - - //如果没有新数据,则不进行操作 - if (this.getList()[addIndex]) { - let res = this.slideList.querySelector(`.slide-item-${addIndex}`) - if (!res) { - this.slideList.appendChild(this.getInsEl(this.getList()[addIndex], addIndex)) - } - let res2 = this.slideList.querySelector(`.slide-item-${removeIndex}`) - if (res2) { - this.appInsMap.get(removeIndex).unmount() - // this.slideList.removeChild(res2) - } - } else { - this.getData(this.pageNo + 1, false) - console.log('没有这条数据') - } - - if (this.index + 5 > this.getList().length) { - this.getData(this.pageNo + 1, false) - } - } - } else { - if (this.index > 0) { - this.index -= 1 - } - if (this.index > 1) { - let addIndex = this.index - 2 - let removeIndex = this.index + 3 - - let res = this.slideList.querySelector(`.slide-item-${addIndex}`) - if (!res) { - this.slideList.insertBefore(this.getInsEl(this.getList()[addIndex], addIndex), this.slideList.firstChild) - } - let res2 = this.slideList.querySelector(`.slide-item-${removeIndex}`) - if (res2) { - this.appInsMap.get(removeIndex).unmount() - // this.slideList.removeChild(res2) - } - } - } - - let nextNode = this.slideList.querySelector(`.slide-item-${this.index} .video-wrapper`) - nextNode && nextNode.dispatchEvent(new Event('play')) - this.setTop() - this.setActive() - } - - - this.css(this.slideList, 'transition-duration', '300ms') - this.css(this.slideList, 'transform', `translate3d(0px, ${this.getHeight()}px, 0px)`) - } - - getList() { - return Array.from(this.listMap.values()).flat() - } - - create(template) { - let tempNode = document.createElement('div'); - tempNode.innerHTML = template.trim(); - return tempNode.firstChild; - } - - css(el, ...args) { - el.style[args[0]] = args[1] - } - - getHeight() { - return -this.index * this.height - } - - setActive() { - this.slideList.childNodes.forEach(v => { - v.classList.remove('active') - }) - this.slideList.childNodes.forEach(v => { - if (v.classList.value.search(this.index) !== -1) { - v.classList.add('active') - } - }) - } - - setTop() { - if (this.index > 1 && this.index < this.getList().length - 2) { - this.slideList.childNodes.forEach(v => { - this.css(v, 'top', (this.index - 2) * this.height + 'px') - }) - } - } -} diff --git a/src/router/routes.js b/src/router/routes.js index 2cc9e00..7727485 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -72,7 +72,6 @@ const routes = [ {path: '/test', component: Test}, {path: '/test4', component: Test4}, - {path: '/video-detail', component: VideoDetail}, {path: '/attention', component: Attention}, {path: '/publish', component: Publish}, @@ -149,6 +148,9 @@ const routes = [ {path: '/home/report', component: Report}, {path: '/home/submit-report', component: SubmitReport}, {path: '/message/share-to-friend', component: Share2Friend}, + + {path: '/video-detail', name: 'video-detail', component: VideoDetail}, + ] export default routes \ No newline at end of file diff --git a/src/store/index.js b/src/store/index.js index 5101a7c..68e7930 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -74,7 +74,7 @@ const store = Vuex.createStore({ store.excludeRoutes.splice(resIndex, 1) } } - console.log('store.excludeRoutes', store.excludeRoutes) + console.log('store.excludeRoutes', store.excludeRoutes,val) }, }, actions: { diff --git a/src/store/pinia.js b/src/store/pinia.js new file mode 100644 index 0000000..a573845 --- /dev/null +++ b/src/store/pinia.js @@ -0,0 +1,11 @@ +import {defineStore} from "pinia"; + +export const useBaseStore = defineStore('base', { + state: () => { + return { + routeData: null + } + }, + getters: {}, + actions: {}, +}) \ No newline at end of file diff --git a/src/utils/index.jsx b/src/utils/index.jsx index bd48bd1..5146af7 100644 --- a/src/utils/index.jsx +++ b/src/utils/index.jsx @@ -7,7 +7,7 @@ import Config from '../config' import NoticeDialog from "../components/dialog/NoticeDialog"; import dayjs from 'dayjs' import bus, {EVENT_KEY} from "./bus"; -import {cloneDeep} from "lodash"; +import {cloneDeep} from "lodash-es"; const Utils = { require2(url) { @@ -453,6 +453,7 @@ export function _checkImgUrl(url) { export function _duration(num){ return Utils.$duration(num) } + export function _formatNumber(num) { return Utils.formatNumber(num) } diff --git a/src/utils/mixin.js b/src/utils/mixin.js index 792678b..d07f37d 100644 --- a/src/utils/mixin.js +++ b/src/utils/mixin.js @@ -14,7 +14,7 @@ import BaseButton from "../components/BaseButton"; import CONST_VAR from "./const_var"; import Dom from "./dom"; import bus, {EVENT_KEY} from "./bus"; -import {random} from "lodash"; +import {random} from "lodash-es"; import {Icon} from '@iconify/vue' import SlideHorizontal from "@/components/slide/SlideHorizontal.vue"; diff --git a/vite.config.js b/vite.config.js index 6998e52..6bee928 100644 --- a/vite.config.js +++ b/vite.config.js @@ -3,6 +3,7 @@ import Vue from '@vitejs/plugin-vue' import VueJsx from '@vitejs/plugin-vue-jsx' import VueMacros from 'unplugin-vue-macros/vite' import {resolve} from 'path' +import DefineOptions from 'unplugin-vue-define-options/vite' // 引入插件 function pathResolve(dir) { return resolve(__dirname, ".", dir) @@ -28,6 +29,8 @@ export default defineConfig({ // // exclude: [/node_modules/, /jQuery\.js/] // // } // }), + DefineOptions(), + Vue(), VueJsx(), ],