You've already forked WhereToGoRedux
mirror of
https://github.com/Llloooggg/WhereToGoRedux.git
synced 2026-03-06 04:56:23 +03:00
Добавлен базовый фронтенд
This commit is contained in:
16
frontend/package-lock.json
generated
Normal file
16
frontend/package-lock.json
generated
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"requires": true,
|
||||
"lockfileVersion": 1,
|
||||
"dependencies": {
|
||||
"n": {
|
||||
"version": "9.0.0",
|
||||
"resolved": "https://registry.npmjs.org/n/-/n-9.0.0.tgz",
|
||||
"integrity": "sha512-OZie4DuAZASChFZnIkf5BYEYEhMe6utRTAWM+98aS6N0pRLNxcDEMwxSsy7is98zTlDICcQB2dym+u10pEOtBg=="
|
||||
},
|
||||
"stable": {
|
||||
"version": "0.1.8",
|
||||
"resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz",
|
||||
"integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w=="
|
||||
}
|
||||
}
|
||||
}
|
||||
24
frontend/wheretogo/README.md
Normal file
24
frontend/wheretogo/README.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# wheretogo
|
||||
|
||||
## Project setup
|
||||
```
|
||||
npm install
|
||||
```
|
||||
|
||||
### Compiles and hot-reloads for development
|
||||
```
|
||||
npm run serve
|
||||
```
|
||||
|
||||
### Compiles and minifies for production
|
||||
```
|
||||
npm run build
|
||||
```
|
||||
|
||||
### Lints and fixes files
|
||||
```
|
||||
npm run lint
|
||||
```
|
||||
|
||||
### Customize configuration
|
||||
See [Configuration Reference](https://cli.vuejs.org/config/).
|
||||
5
frontend/wheretogo/babel.config.js
Normal file
5
frontend/wheretogo/babel.config.js
Normal file
@@ -0,0 +1,5 @@
|
||||
module.exports = {
|
||||
presets: [
|
||||
'@vue/cli-plugin-babel/preset'
|
||||
]
|
||||
}
|
||||
20
frontend/wheretogo/jsconfig.json
Normal file
20
frontend/wheretogo/jsconfig.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"module": "esnext",
|
||||
"baseUrl": "./",
|
||||
"moduleResolution": "node",
|
||||
"paths": {
|
||||
"@/*": [
|
||||
"src/*"
|
||||
]
|
||||
},
|
||||
"lib": [
|
||||
"esnext",
|
||||
"dom",
|
||||
"dom.iterable",
|
||||
"scripthost"
|
||||
],
|
||||
"jsx": "preserve"
|
||||
}
|
||||
}
|
||||
19941
frontend/wheretogo/package-lock.json
generated
Normal file
19941
frontend/wheretogo/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
44
frontend/wheretogo/package.json
Normal file
44
frontend/wheretogo/package.json
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"name": "wheretogo",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build",
|
||||
"lint": "vue-cli-service lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^0.27.2",
|
||||
"core-js": "^3.8.3",
|
||||
"vue": "^3.2.13"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.12.16",
|
||||
"@babel/eslint-parser": "^7.12.16",
|
||||
"@vue/cli-plugin-babel": "~5.0.0",
|
||||
"@vue/cli-plugin-eslint": "~5.0.0",
|
||||
"@vue/cli-service": "~5.0.0",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-plugin-vue": "^8.0.3"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
"env": {
|
||||
"node": true
|
||||
},
|
||||
"extends": [
|
||||
"plugin:vue/vue3-essential",
|
||||
"eslint:recommended"
|
||||
],
|
||||
"parserOptions": {
|
||||
"parser": "@babel/eslint-parser"
|
||||
},
|
||||
"rules": {}
|
||||
},
|
||||
"browserslist": [
|
||||
"> 1%",
|
||||
"last 2 versions",
|
||||
"not dead",
|
||||
"not ie 11"
|
||||
]
|
||||
}
|
||||
BIN
frontend/wheretogo/public/favicon.ico
Normal file
BIN
frontend/wheretogo/public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
17
frontend/wheretogo/public/index.html
Normal file
17
frontend/wheretogo/public/index.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||
<title><%= htmlWebpackPlugin.options.title %></title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
||||
</noscript>
|
||||
<div id="app"></div>
|
||||
<!-- built files will be auto injected -->
|
||||
</body>
|
||||
</html>
|
||||
24
frontend/wheretogo/src/App.vue
Normal file
24
frontend/wheretogo/src/App.vue
Normal file
@@ -0,0 +1,24 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<FacilitiesList />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import FacilitiesList from "./components/FacilitiesList.vue";
|
||||
export default {
|
||||
name: "App",
|
||||
components: {
|
||||
FacilitiesList,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
#app {
|
||||
font-family: Avenir, Helvetica, Arial, sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
text-align: center;
|
||||
color: #2c3e50;
|
||||
margin-top: 60px;
|
||||
}
|
||||
</style>
|
||||
59
frontend/wheretogo/src/__VLS_options.jsx
Normal file
59
frontend/wheretogo/src/__VLS_options.jsx
Normal file
@@ -0,0 +1,59 @@
|
||||
export default (await import('vue')).defineComponent({
|
||||
name: "App",
|
||||
components: {
|
||||
FacilitiesList,
|
||||
},
|
||||
});
|
||||
const __VLS_options = {
|
||||
...({
|
||||
name: "App",
|
||||
components: {
|
||||
FacilitiesList,
|
||||
},
|
||||
}),
|
||||
};
|
||||
const __VLS_name = (await import('./__VLS_types.js')).getNameOption({
|
||||
name: "App",
|
||||
components: {
|
||||
FacilitiesList,
|
||||
},
|
||||
} as const);
|
||||
function __VLS_template() {
|
||||
import * as __VLS_types from './__VLS_types.js'; import('./__VLS_types.js');
|
||||
let __VLS_ctx!: __VLS_types.PickNotAny<__VLS_Ctx, {}> & InstanceType<__VLS_types.PickNotAny<typeof __VLS_component, new () => {}>> & {};
|
||||
let __VLS_vmUnwrap!: typeof __VLS_options & { components: {}; };
|
||||
/* Components */
|
||||
let __VLS_otherComponents!: NonNullable<typeof __VLS_component extends { components: infer C; } ? C : {}> & __VLS_types.GlobalComponents & typeof __VLS_vmUnwrap.components & __VLS_types.PickComponents<typeof __VLS_ctx>;
|
||||
let __VLS_selfComponent!: __VLS_types.SelfComponent<typeof __VLS_name, typeof __VLS_component & (new () => { $slots: typeof __VLS_slots; })>;
|
||||
let __VLS_components!: typeof __VLS_otherComponents & Omit<typeof __VLS_selfComponent, keyof typeof __VLS_otherComponents>;
|
||||
__VLS_components['/* __VLS_.SearchTexts.Components */'];
|
||||
({} as __VLS_types.GlobalAttrs)['/* __VLS_.SearchTexts.GlobalAttrs */'];
|
||||
/* Style Scoped */
|
||||
type __VLS_StyleScopedClasses = {};
|
||||
let __VLS_styleScopedClasses!: __VLS_StyleScopedClasses | keyof __VLS_StyleScopedClasses | (keyof __VLS_StyleScopedClasses)[];
|
||||
/* CSS variable injection */
|
||||
/* CSS variable injection end */
|
||||
declare const FacilitiesList: __VLS_types.ConvertInvalidJsxElement<
|
||||
'FacilitiesList' extends keyof typeof __VLS_components ? typeof __VLS_components['FacilitiesList'] : 'FacilitiesList' extends keyof typeof __VLS_ctx ? typeof __VLS_ctx['FacilitiesList'] : unknown>;
|
||||
__VLS_components.FacilitiesList;
|
||||
__VLS_ctx.FacilitiesList;
|
||||
declare const __VLS_0: __VLS_types.ExtractEmit2<typeof FacilitiesList>;
|
||||
/* Completion: Emits */
|
||||
// @ts-ignore
|
||||
__VLS_0('/* __VLS_.SearchTexts.Completion.Emit.FacilitiesList */');
|
||||
/* Completion: Props */
|
||||
// @ts-ignore
|
||||
(<FacilitiesList /* __VLS_.SearchTexts.Completion.Props.FacilitiesList */ />);
|
||||
{
|
||||
<div id={"\u0061\u0070\u0070"}></div>;
|
||||
|
||||
{
|
||||
<FacilitiesList />;
|
||||
}
|
||||
}
|
||||
if (typeof __VLS_styleScopedClasses === 'object' && !Array.isArray(__VLS_styleScopedClasses)) {
|
||||
}
|
||||
declare var __VLS_slots: {};
|
||||
return __VLS_slots;
|
||||
}
|
||||
let __VLS_component!: typeof import('./App.vue')['default'];
|
||||
BIN
frontend/wheretogo/src/assets/logo.png
Normal file
BIN
frontend/wheretogo/src/assets/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.7 KiB |
37
frontend/wheretogo/src/components/FacilitiesList.vue
Normal file
37
frontend/wheretogo/src/components/FacilitiesList.vue
Normal file
@@ -0,0 +1,37 @@
|
||||
<template>
|
||||
<div class="facilities_container">
|
||||
<div class="facilities_content">
|
||||
<h1>Facilities</h1>
|
||||
<ul class="facilities_list">
|
||||
<li v-for="facility in facilities" :key="facility.id">
|
||||
<h2>{{ facility.name }}</h2>
|
||||
<p>{{ facility.address }}</p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
facilities: ['']
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getData() {
|
||||
try {
|
||||
const response = await this.axios.get('http://127.0.0.1:8000/api/facilities');
|
||||
this.facilities = response.data;
|
||||
console.log(this.facilities)
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getData();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
9
frontend/wheretogo/src/main.js
Normal file
9
frontend/wheretogo/src/main.js
Normal file
@@ -0,0 +1,9 @@
|
||||
import { createApp } from 'vue'
|
||||
import App from './App.vue'
|
||||
import axios from 'axios'
|
||||
|
||||
const app = createApp(App)
|
||||
|
||||
app.config.globalProperties.axios=axios
|
||||
|
||||
app.mount('#app')
|
||||
4
frontend/wheretogo/vue.config.js
Normal file
4
frontend/wheretogo/vue.config.js
Normal file
@@ -0,0 +1,4 @@
|
||||
import { defineConfig } from '@vue/cli-service'
|
||||
export default defineConfig({
|
||||
transpileDependencies: true
|
||||
})
|
||||
Reference in New Issue
Block a user