From 63aa7c73db96e5a6af4777e6232fb0511e48b8ab Mon Sep 17 00:00:00 2001 From: reddigriz Date: Tue, 6 Sep 2022 15:36:46 +0200 Subject: [PATCH] Aggiunto json con lista preview chat demo, fixato ChatMsg, impostato flow dati history --- geografia-vue/README.md | 48 ---------------- geografia-vue/src/assets/demo_chats.json | 58 ++++++++++++++++++++ geografia-vue/src/components/ChatHistory.vue | 2 +- geografia-vue/src/components/ChatList.vue | 26 ++------- geografia-vue/src/components/ChatMsg.vue | 42 +++++++------- geografia-vue/src/components/ChatPreview.vue | 6 +- geografia-vue/src/stores/counter.js | 16 ------ geografia-vue/src/views/HomeView.vue | 9 --- geografia-vue/vite.config.js | 3 + 9 files changed, 90 insertions(+), 120 deletions(-) delete mode 100644 geografia-vue/README.md create mode 100644 geografia-vue/src/assets/demo_chats.json delete mode 100644 geografia-vue/src/stores/counter.js delete mode 100644 geografia-vue/src/views/HomeView.vue diff --git a/geografia-vue/README.md b/geografia-vue/README.md deleted file mode 100644 index d57042e..0000000 --- a/geografia-vue/README.md +++ /dev/null @@ -1,48 +0,0 @@ -# geografia_vue - -This template should help get you started developing with Vue 3 in Vite. - -## Recommended IDE Setup - -[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin). - -## Customize configuration - -See [Vite Configuration Reference](https://vitejs.dev/config/). - -## Project Setup - -```sh -npm install -``` - -### Compile and Hot-Reload for Development - -```sh -npm run dev -``` - -### Compile and Minify for Production - -```sh -npm run build -``` - -### Run Unit Tests with [Vitest](https://vitest.dev/) - -```sh -npm run test:unit -``` - -### Run End-to-End Tests with [Cypress](https://www.cypress.io/) - -```sh -npm run build -npm run test:e2e # or `npm run test:e2e:ci` for headless testing -``` - -### Lint with [ESLint](https://eslint.org/) - -```sh -npm run lint -``` diff --git a/geografia-vue/src/assets/demo_chats.json b/geografia-vue/src/assets/demo_chats.json new file mode 100644 index 0000000..ddff6c0 --- /dev/null +++ b/geografia-vue/src/assets/demo_chats.json @@ -0,0 +1,58 @@ +{ + "history": [ + { + "id": 1, + "name": "test-name1", + "last_message": "馃惐鉀革笍鉃★笍?", + "seen": false, + "date": "25/08/22", + "new_messages": 1, + "is_user": false + }, + { + "id": 2, + "name": "test-name2", + "last_message": "馃惐鉀革笍鉃★笍?", + "seen": false, + "date": "25/08/22", + "new_messages": 1, + "is_user": true + }, + { + "id": 3, + "name": "test-name3", + "last_message": "馃惐鉀革笍鉃★笍?", + "seen": false, + "date": "25/08/22", + "new_messages": 1, + "is_user": false + }, + { + "id": 4, + "name": "test-name4", + "last_message": "馃惐鉀革笍鉃★笍?", + "seen": false, + "date": "25/08/22", + "new_messages": 1, + "is_user": true + }, + { + "id": 5, + "name": "test-name5", + "last_message": "馃惐鉀革笍鉃★笍?", + "seen": false, + "date": "25/08/22", + "new_messages": 1, + "is_user": false + }, + { + "id": 6, + "name": "test-name6", + "last_message": "馃惐鉀革笍鉃★笍?", + "seen": false, + "date": "25/08/22", + "new_messages": 1, + "is_user": true + } + ] +} diff --git a/geografia-vue/src/components/ChatHistory.vue b/geografia-vue/src/components/ChatHistory.vue index 19c2246..215ec64 100644 --- a/geografia-vue/src/components/ChatHistory.vue +++ b/geografia-vue/src/components/ChatHistory.vue @@ -6,7 +6,7 @@ diff --git a/geografia-vue/src/components/ChatList.vue b/geografia-vue/src/components/ChatList.vue index 78a634c..6f644ab 100644 --- a/geografia-vue/src/components/ChatList.vue +++ b/geografia-vue/src/components/ChatList.vue @@ -5,40 +5,22 @@ import ChatMsg from "@/components/ChatMsg.vue"; diff --git a/geografia-vue/src/components/ChatMsg.vue b/geografia-vue/src/components/ChatMsg.vue index 3c76dba..6571c7e 100644 --- a/geografia-vue/src/components/ChatMsg.vue +++ b/geografia-vue/src/components/ChatMsg.vue @@ -1,9 +1,9 @@ @@ -11,33 +11,33 @@ export default { setup() {}, props: { - msgText: String, + messageText: String, isUser: Boolean, }, }; diff --git a/geografia-vue/src/components/ChatPreview.vue b/geografia-vue/src/components/ChatPreview.vue index df653e6..b94758b 100644 --- a/geografia-vue/src/components/ChatPreview.vue +++ b/geografia-vue/src/components/ChatPreview.vue @@ -7,8 +7,8 @@

{{ chatName }}

-
-

{{ chatLastMsg }}

+
+

{{ chatLastMessage }}

@@ -36,7 +36,7 @@ export default { props: { picProfile: String, chatName: String, - chatLastMsg: String, + chatLastMessage: String, chatSeen: Boolean, chatDate: String, chatNewMessages: Number, diff --git a/geografia-vue/src/stores/counter.js b/geografia-vue/src/stores/counter.js deleted file mode 100644 index 252406e..0000000 --- a/geografia-vue/src/stores/counter.js +++ /dev/null @@ -1,16 +0,0 @@ -import { defineStore } from "pinia"; - -export const useCounterStore = defineStore({ - id: "counter", - state: () => ({ - counter: 0, - }), - getters: { - doubleCount: (state) => state.counter * 2, - }, - actions: { - increment() { - this.counter++; - }, - }, -}); diff --git a/geografia-vue/src/views/HomeView.vue b/geografia-vue/src/views/HomeView.vue deleted file mode 100644 index 0fbaad4..0000000 --- a/geografia-vue/src/views/HomeView.vue +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/geografia-vue/vite.config.js b/geografia-vue/vite.config.js index b20d948..c5d4c28 100644 --- a/geografia-vue/vite.config.js +++ b/geografia-vue/vite.config.js @@ -7,6 +7,9 @@ import vueJsx from "@vitejs/plugin-vue-jsx"; // https://vitejs.dev/config/ export default defineConfig({ plugins: [vue(), vueJsx()], + build: { + sourcemap: true, + }, resolve: { alias: { "@": fileURLToPath(new URL("./src", import.meta.url)),