Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
weizhanzhan committed Aug 17, 2022
1 parent 04da2b7 commit 2bc7e32
Show file tree
Hide file tree
Showing 7 changed files with 10,090 additions and 25 deletions.
32 changes: 32 additions & 0 deletions components.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// generated by unplugin-vue-components
// We suggest you to commit this file into source control
// Read more: https://github.com/vuejs/core/pull/3399
import '@vue/runtime-core'

export {}

declare module '@vue/runtime-core' {
export interface GlobalComponents {
AppContainer: typeof import('./src/components/AppContainer/index.vue')['default']
HelloWorld: typeof import('./src/components/HelloWorld.vue')['default']
Navbar: typeof import('./src/components/Navbar.vue')['default']
Recommend: typeof import('./src/components/Recommend.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
VanButton: typeof import('vant/es')['Button']
VanEmpty: typeof import('vant/es')['Empty']
VanField: typeof import('vant/es')['Field']
VanIcon: typeof import('vant/es')['Icon']
VanList: typeof import('vant/es')['List']
VanNavBar: typeof import('vant/es')['NavBar']
VanPopover: typeof import('vant/es')['Popover']
VanSwipe: typeof import('vant/es')['Swipe']
VanSwipeCell: typeof import('vant/es')['SwipeCell']
VanSwipeItem: typeof import('vant/es')['SwipeItem']
VanTab: typeof import('vant/es')['Tab']
VanTabbar: typeof import('vant/es')['Tabbar']
VanTabbarItem: typeof import('vant/es')['TabbarItem']
VanTabs: typeof import('vant/es')['Tabs']
VanUploader: typeof import('vant/es')['Uploader']
}
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"less-loader": "^7.0.1",
"postcss-px-to-viewport": "^1.1.1",
"ts-import-plugin": "^1.6.6",
"vant": "^3.0.0-alpha.3",
"vant": "^3.5.3",
"vue": "^3.2.20",
"vue-class-component": "^8.0.0-0",
"vue-router": "^4.0.0-0",
Expand All @@ -39,6 +39,7 @@
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-vue": "^7.0.0-0",
"prettier": "^1.19.1",
"typescript": "4.3.5"
"typescript": "4.3.5",
"unplugin-vue-components": "^0.22.4"
}
}
4 changes: 2 additions & 2 deletions src/mock/video.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const state = reactive({
current: 0
});
const useVideo = () => {
return new Promise<Array<{ key: number }>>((resolve, reject) => {
return new Promise<Array<{ key: number }>>(resolve => {
const videoLength = videoList.length;
const { page, size, initStart } = state;
const start = page * size + initStart;
Expand All @@ -85,7 +85,7 @@ const useVideo = () => {
};

const useVideoCurrent = () => {
return new Promise<Array<{ key: number }>>((resolve, reject) => {
return new Promise<Array<{ key: number }>>(resolve => {
const { current } = state;
let result: Array<{ key: number }> = [];
if (current + 1 >= videoList.length) {
Expand Down
1 change: 0 additions & 1 deletion src/router/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { useRandomName } from "./../utils/utils";
import provideStore from "@/utils/provideStore";

import {
createRouter,
Expand Down
63 changes: 43 additions & 20 deletions src/views/message/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -142,26 +142,49 @@ export default defineComponent({
}
};
const getMessages = async () => {
const messages = await form.findAll();
const init: BmobMessageOption = {
objectId: "1",
name: "zhanzhan.wei",
content:
"Hello everyone! 欢迎大家,请适当言论,喜欢记得给个star呀!(づ ̄ 3 ̄)づ",
files: [
require("../../assets/images/1.png"),
require("../../assets/images/2.png"),
require("../../assets/images/3.png"),
require("../../assets/images/4.png"),
require("../../assets/images/qrcode.jpg"),
require("../../assets/images/5.png"),
require("../../assets/images/6.png"),
require("../../assets/images/7.png"),
require("../../assets/images/8.png")
],
state: false
};
state.messages = [init, ...messages];
console.log(1);
try {
const messages = await form.findAll();
const init: BmobMessageOption = {
objectId: "1",
name: "zhanzhan.wei",
content:
"Hello everyone! 欢迎大家,请适当言论,喜欢记得给个star呀!(づ ̄ 3 ̄)づ",
files: [
require("../../assets/images/1.png"),
require("../../assets/images/2.png"),
require("../../assets/images/3.png"),
require("../../assets/images/4.png"),
require("../../assets/images/qrcode.jpg"),
require("../../assets/images/5.png"),
require("../../assets/images/6.png"),
require("../../assets/images/7.png"),
require("../../assets/images/8.png")
],
state: false
};
state.messages = [init, ...messages];
} catch (error) {
const init: BmobMessageOption = {
objectId: "1",
name: "zhanzhan.wei",
content:
"Hello everyone! 欢迎大家,请适当言论,喜欢记得给个star呀!(づ ̄ 3 ̄)づ",
files: [
require("../../assets/images/1.png"),
require("../../assets/images/2.png"),
require("../../assets/images/3.png"),
require("../../assets/images/4.png"),
require("../../assets/images/qrcode.jpg"),
require("../../assets/images/5.png"),
require("../../assets/images/6.png"),
require("../../assets/images/7.png"),
require("../../assets/images/8.png")
],
state: false
};
state.messages = [init];
}
};
// 留言
Expand Down
8 changes: 8 additions & 0 deletions vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ function resolve(dir) {
return path.join(__dirname, dir);
}

const { VantResolver } = require("unplugin-vue-components/resolvers");
const ComponentsPlugin = require("unplugin-vue-components/webpack");

// eslint-disable-next-line @typescript-eslint/no-var-requires
const autoprefixer = require("autoprefixer");
module.exports = {
Expand Down Expand Up @@ -44,6 +47,11 @@ module.exports = {
},
//配置路径别名
configureWebpack: {
plugins: [
ComponentsPlugin({
resolvers: [VantResolver()]
})
],
resolve: {
alias: {
"@": resolve("src"),
Expand Down
Loading

1 comment on commit 2bc7e32

@vercel
Copy link

@vercel vercel bot commented on 2bc7e32 Aug 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.