Top Related Projects
🎉 A curated list of awesome things related to Vue.js
An exemplary real-world application built with Vue.js, Vuex, axios and different other technologies. This is a good example to discover Vue for beginners.
:tada: A magical vue admin https://panjiachen.github.io/vue-element-admin
Large single page application with 45 pages built on vue2 + vuex. 基于 vue2 + vuex 构建一个具有 45 个页面的大型单页面应用
A Vue.js 2.0 UI Toolkit for Web
Quick Overview
Vue-store is a simple e-commerce web application built using Vue.js. It demonstrates the implementation of a basic online store with features such as product listing, shopping cart functionality, and user authentication.
Pros
- Provides a clear example of building an e-commerce application with Vue.js
- Includes both frontend and backend components for a complete application structure
- Implements common e-commerce features like product browsing and cart management
- Uses modern Vue.js practices and components
Cons
- Limited documentation and comments in the code
- Lacks advanced e-commerce features like payment processing or order management
- May not be suitable for production use without significant enhancements
- UI design is relatively basic and may require improvement for a professional look
Code Examples
Here are a few code examples from the project:
- Product listing component:
<template>
<div class="goods-list">
<div class="goods-item" v-for="item in goodsList" :key="item.id">
<div class="goods-img">
<img :src="item.img" alt="">
</div>
<div class="goods-info">
<p>{{item.name}}</p>
<p class="price">¥{{item.price}}</p>
</div>
</div>
</div>
</template>
- Adding an item to the cart:
addShoppingCart() {
if (!this.user.username) {
Toast("Please login first");
return;
}
this.$http
.post("/api/user/shoppingCart/add", {
productId: this.productID,
num: this.num
})
.then(res => {
if (res.data.code === "001") {
Toast("Added to cart successfully");
} else {
Toast(res.data.msg);
}
})
.catch(err => {
console.log(err);
});
}
- User login action:
login() {
this.$http
.post("/api/users/login", {
username: this.username,
password: this.password
})
.then(res => {
if (res.data.code === "001") {
this.$store.commit("setUser", res.data.user);
this.$router.push({ path: "/" });
} else {
this.toast = this.$createToast({
txt: res.data.msg,
type: "error"
});
this.toast.show();
}
})
.catch(err => {
console.log(err);
});
}
Getting Started
To run the vue-store project locally:
-
Clone the repository:
git clone https://github.com/hai-27/vue-store.git
-
Install dependencies:
cd vue-store npm install
-
Start the development server:
npm run serve
-
Open your browser and navigate to
http://localhost:8080
to view the application.
Competitor Comparisons
🎉 A curated list of awesome things related to Vue.js
Pros of awesome-vue
- Comprehensive resource collection for Vue.js ecosystem
- Regularly updated with community contributions
- Covers a wide range of topics, from tutorials to components
Cons of awesome-vue
- Not a functional application, primarily a curated list
- May be overwhelming for beginners due to the sheer volume of resources
- Requires external exploration of listed resources
Code comparison
vue-store:
<template>
<div id="app">
<router-view></router-view>
</div>
</template>
<script>
export default {
name: 'App'
}
</script>
awesome-vue:
## Official Resources
- [Official Guide](https://vuejs.org/v2/guide/)
- [API Reference](https://vuejs.org/v2/api/)
- [GitHub Repo](https://github.com/vuejs/vue)
- [Release Notes](https://github.com/vuejs/vue/releases)
Summary
vue-store is a practical e-commerce application built with Vue.js, providing a hands-on example of Vue implementation. It offers a complete, functional store with features like product listing and shopping cart.
awesome-vue, on the other hand, is a curated list of Vue.js resources, components, and tools. It serves as a comprehensive reference for developers looking to explore the Vue ecosystem but doesn't provide a working application itself.
While vue-store demonstrates practical Vue usage, awesome-vue offers a broader overview of available resources and tools in the Vue community. The choice between them depends on whether you need a practical example or a comprehensive resource guide.
An exemplary real-world application built with Vue.js, Vuex, axios and different other technologies. This is a good example to discover Vue for beginners.
Pros of vue-realworld-example-app
- More comprehensive and feature-rich, implementing a full-fledged social blogging platform
- Better organized codebase with clear separation of concerns and modular architecture
- Follows Vue.js best practices and conventions more closely
Cons of vue-realworld-example-app
- More complex and potentially overwhelming for beginners
- Requires a deeper understanding of Vue.js ecosystem and advanced concepts
- Less focused on e-commerce specific features compared to vue-store
Code Comparison
vue-realworld-example-app:
import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
Vue.config.productionTip = false;
new Vue({
router,
store,
render: h => h(App)
}).$mount("#app");
vue-store:
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
Vue.config.productionTip = false
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')
Both projects use similar main.js files, demonstrating standard Vue.js application setup. However, vue-realworld-example-app generally has more structured and modular code throughout the project, while vue-store focuses more on e-commerce specific components and functionality.
:tada: A magical vue admin https://panjiachen.github.io/vue-element-admin
Pros of vue-element-admin
- More comprehensive and feature-rich admin panel solution
- Extensive documentation and community support
- Includes advanced features like permission control and i18n
Cons of vue-element-admin
- Steeper learning curve due to its complexity
- May be overkill for smaller projects or simple e-commerce sites
- Requires more setup and configuration
Code Comparison
vue-element-admin:
import permission from './permission'
import element from './element'
import settings from './settings'
Vue.use(permission)
Vue.use(element, { size: settings.elementSize })
vue-store:
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
Vue.config.productionTip = false
vue-element-admin offers a more complex setup with additional modules for permissions and element UI configuration, while vue-store provides a simpler Vue.js initialization. The former is better suited for large-scale admin panels, while the latter is more appropriate for smaller e-commerce projects.
vue-element-admin includes more advanced features out of the box, but vue-store offers a lighter-weight solution that may be easier to customize for specific e-commerce needs. The choice between the two depends on the project's requirements and complexity.
Large single page application with 45 pages built on vue2 + vuex. 基于 vue2 + vuex 构建一个具有 45 个页面的大型单页面应用
Pros of vue2-elm
- More comprehensive and feature-rich, simulating a real-world food delivery application
- Includes advanced features like geolocation and complex state management
- Larger community and more stars on GitHub, indicating wider adoption and potential support
Cons of vue2-elm
- Older project with less frequent updates, potentially using outdated dependencies
- More complex codebase, which may be harder for beginners to understand and navigate
- Focuses on a specific use case (food delivery), which may limit its applicability as a general learning resource
Code Comparison
vue2-elm:
import Vue from 'vue'
import VueRouter from 'vue-router'
import routes from './router/router'
import store from './store/'
import {routerMode} from './config/env'
import './config/rem'
vue-store:
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './plugins/element.js'
import './assets/css/global.css'
Both projects use Vue.js and Vuex for state management, but vue2-elm appears to have more complex routing and configuration setup. vue-store has a simpler structure and includes Element UI as a UI framework, which may be more suitable for beginners or smaller projects.
A Vue.js 2.0 UI Toolkit for Web
Pros of element
- Comprehensive UI component library with extensive documentation
- Large community support and regular updates
- Wide range of pre-built components for rapid development
Cons of element
- Larger bundle size due to extensive component library
- Steeper learning curve for beginners
- Less flexibility for custom styling compared to a custom-built solution
Code Comparison
element:
<el-button type="primary" @click="handleClick">Click me</el-button>
<el-input v-model="inputValue" placeholder="Enter text"></el-input>
<el-table :data="tableData" style="width: 100%">
<el-table-column prop="name" label="Name"></el-table-column>
<el-table-column prop="address" label="Address"></el-table-column>
</el-table>
vue-store:
<button class="btn" @click="handleClick">Click me</button>
<input v-model="inputValue" placeholder="Enter text">
<table>
<tr v-for="item in tableData" :key="item.id">
<td>{{ item.name }}</td>
<td>{{ item.address }}</td>
</tr>
</table>
The code comparison shows that element provides pre-built components with specific props and styling, while vue-store uses more basic HTML elements that require custom styling and functionality. element offers a more standardized approach, while vue-store allows for greater customization but requires more manual implementation.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Storeï¼åèå°ç±³ååï¼
åè¨
2020å¹´å¯åå°¤å
¶ç¹æ®ï¼å 为æ°åå ç¶ç
æ¯èºçç«æ
ï¼å¦æ ¡è³ä»æ²¡æå¼å¦ãæ³èµ·ä¸å¦æå©ç¨è¯¾ä½æ¶é´å¦ä¹ äºVue.js
ãNode.js
ï¼ä¸ç´æ³å个å®æ´ç项ç®å®æä¸ä¸ï¼ä½ä¹åå¨å¦æ ¡å¹¶æ²¡æé£ä¹å¤çæ¶é´ãç°å¨æ°å¥½ææ¶é´ï¼å°±æ³çåä¸ä¸ªé¡¹ç®å·©åºä¹åå¦å°çä¸è¥¿ã
ææ¥æ³å»ï¼æåå³å®æ¨¡ä»¿ å°ç±³åå åä¸ä¸ªçµå项ç®ãå¯è½æ¶é´éå¾æç¹ä¹ äºï¼ä¹åå¦çä¸è¥¿å¾å¤é½å·®ä¸å¤å¿è®°äºï¼åè¿ä¸ªé¡¹ç®åºæ¬ä¸é½æ¯ççå®æ¹çææ¡£ä¸ç¹ä¸ç¹åçãå¨å®¶éä¹å ä¸äºæåç§åæ ·çäºæ è½è¯¯äºé¡¹ç®çè¿åº¦ãç°å¨ç»äºå·®ä¸å¤å好äºï¼å享åºæ¥ï¼æ°æä¸è·¯ï¼å¦æé误ï¼è¯·å¤å¤ææã
说æ
æ¬é¡¹ç®åå端å离ï¼å端åè å°ç±³åå å®ç°ï¼ä½ä¸å°ç±³å®æ¹æ²¡æå ³ç³»ï¼çº¯å±ä¸ªäººçæï¼è¥éè¦è´ä¹°å°ç±³äº§å请å°å°ç±³å®æ¹ååã
è¿æ¯æ¬é¡¹ç®çå端ï¼å端请移æ¥å°store-server ã
å端已ç»é¨ç½²å¨é¿éäºï¼æ¬¢è¿è®¿é® http://101.132.181.9/ ï¼æ²¡æå ¼å®¹ç§»å¨ç«¯ï¼è¯·ä½¿ç¨çµè访é®ï¼ã
å端ä¹å·²ç»é¨ç½²å¨é¿éäºï¼æ¥å£å°åå·²ç»ä¿®æ¹ä¸ºçº¿ä¸å°åï¼æ¬å°è¿è¡å端ä¹å¯ä»¥æ£å¸¸è®¿é®å端ã
æ¬äººå¨è¯»æ¬ç§å¤§ä¸ï¼ä»å¹´æåå³å°å¼å§å®ä¹ ï¼åé¢çæ¶é´å¯è½æ²¡æé£ä¹çèªç±ï¼ä½ä¼ä¸å®æçæ´æ°å®å该项ç®ï¼å¦æé®é¢è¯·ç´æ¥å¨ Issues ä¸æã
å¦æè§å¾è¿ä¸ªé¡¹ç®è¿ä¸éï¼æ¨å¯ä»¥ç¹å³ä¸è§
Star
æ¯æä¸ä¸ï¼ è°¢è°¢ï¼ ^_^
项ç®ç®ä»
æ¬é¡¹ç®åå端å离ï¼å端åºäºVue
+Vue-router
+Vuex
+Element-ui
+Axios
ï¼åèå°ç±³ååå®ç°ãå端åºäºNode.js(Koaæ¡æ¶)
+Mysql
å®ç°ã
å端å å«äº11个页é¢ï¼é¦é¡µãç»å½ã注åãå ¨é¨ååãåå详æ 页ãå ³äºæ们ãæçæ¶èãè´ç©è½¦ã订åç»ç®é¡µé¢ãæç订å以åé误å¤ç页é¢ã
å®ç°äºååçå±ç¤ºãåååç±»æ¥è¯¢ãå ³é®åæç´¢ååãåå详ç»ä¿¡æ¯å±ç¤ºãç»å½ã注åãç¨æ·è´ç©è½¦ã订åç»ç®ãç¨æ·è®¢åãç¨æ·æ¶èå表以åé误å¤çåè½ã
å端éåäºMVC模å¼ï¼æ ¹æ®å端éè¦çæ°æ®å模å设计äºç¸åºçæ¥å£ãæ§å¶å±ãæ°æ®æä¹ å±ãåç«¯ä¼ éå°åstore-server ã
ææ¯æ
-
å端ï¼
Vue
+Vue-router
+Vuex
+Element-ui
+Axios
-
å端ï¼
Node.js
ãKoaæ¡æ¶
-
æ°æ®åºï¼
Mysql
åè½æ¨¡å
ç»å½
页é¢ä½¿ç¨äºelement-uiçDialog
å®ç°å¼¹åºèç对è¯æ¡çææï¼ç»å½
æé®è®¾ç½®å¨App.vueæ ¹ç»ä»¶ï¼éè¿vuex
ä¸çshowLogin
ç¶ææ§å¶ç»å½æ¡æ¯å¦æ¾ç¤ºã
è¿æ ·è®¾è®¡æ¯ä¸ºäºæ¢å¯ä»¥éè¿ç¹å»é¡µé¢ä¸çæé®ç»å½ï¼ä¹å¯ä»¥æ¯ç¨æ·è®¿é®éè¦ç»å½éªè¯ç页é¢æå端è¿åéè¦éªè¯ç»å½çæ示åèªå¨å¼¹åºç»å½æ¡ï¼åå°äºé¡µé¢ç跳转ï¼ç®åç¨æ·æä½ã
ç¨æ·è¾å ¥çæ°æ®å¾å¾æ¯ä¸å¯é çï¼æ以æ¬é¡¹ç®åå端é½å¯¹ç»å½ä¿¡æ¯è¿è¡äºæ ¡éªï¼å端åºäºelement-uiç表åæ ¡éªæ¹å¼ï¼èªå®ä¹äºæ ¡éªè§åè¿è¡æ ¡éªã
注å
页é¢åæ ·ä½¿ç¨äºelement-uiçDialog
å®ç°å¼¹åºèç对è¯æ¡çææï¼æ³¨å
æé®è®¾ç½®å¨App.vueæ ¹ç»ä»¶ï¼éè¿ç¶åç»ä»¶ä¼ å¼æ§å¶æ³¨åæ¡æ¯å¦æ¾ç¤ºã
ç¨æ·è¾å ¥çæ°æ®å¾å¾æ¯ä¸å¯é çï¼æ以æ¬é¡¹ç®åå端åæ ·é½å¯¹æ³¨åä¿¡æ¯è¿è¡äºæ ¡éªï¼å端åºäºelement-uiç表åæ ¡éªæ¹å¼ï¼èªå®ä¹äºæ ¡éªè§åè¿è¡æ ¡éªã
é¦é¡µ
é¦é¡µä¸»è¦æ¯å¯¹ååçå±ç¤ºï¼æè½®æå¾å±ç¤ºæ¨èçååï¼åç±»å«å¯¹çé¨ååè¿è¡å±ç¤ºã
å ¨é¨åå
å ¨é¨åå页é¢éæäºå ¨é¨ååå±ç¤ºãåååç±»æ¥è¯¢ï¼ä»¥åæ ¹æ®å ³é®åæç´¢ååç»æå±ç¤ºã
åå详æ 页
åå详æ 页主è¦æ¯å¯¹æ个ååç详ç»ä¿¡æ¯è¿è¡å±ç¤ºï¼ç¨æ·å¯ä»¥å¨è¿éæå欢çååå å ¥è´ç©è½¦ææ¶èå表ã
æçè´ç©è½¦
è´ç©è½¦éç¨vuexå®ç°ï¼é¡µé¢ææåèäºå°ç±³ååçè´ç©è½¦ã
详ç»å®ç°è¿ç¨è¯·çï¼åºäºVuexå®ç°å°ç±³ååè´ç©è½¦
订åç»ç®
ç¨æ·å¨è´ç©è½¦éæ©äºåå¤è´ä¹°çåååï¼ç¹å»âå»ç»ç®âæé®ï¼ä¼æ¥å°è¯¥é¡µé¢ã ç¨æ·å¨è¿ééæ©æ¶è´§å°åï¼ç¡®è®¤è®¢åçç¸å ³ä¿¡æ¯ï¼ç¶å确认è´ä¹°ã
æçæ¶è
ç¨æ·å¨ååç详æ 页ï¼å¯ä»¥éè¿ç¹å»å å ¥ å欢 æé®ï¼æå欢çååå å ¥å°æ¶èå表ã
æç订å
对ç¨æ·çææ订åè¿è¡å±ç¤ºã
è¿è¡é¡¹ç®
注æï¼
- å端æ¥å£å°åå·²ç»ä¿®æ¹ä¸ºçº¿ä¸çå°åï¼æ¬å°è¿è¡ä¼ç´æ¥å为æé¨ç½²å¨æå¡å¨çå端ã
- 为äºæ¹ä¾¿æµè¯ï¼æ°æ®åºæ°æ®æ²¡æå å¯ï¼æ³¨åæ¶åè®°ä¸è¦ä½¿ç¨èªå·±ç常ç¨å¯ç ã
- å¦æéè¦èªå·±è¿è¡å端ï¼è¯·ç§»æ¥å°store-server cloneå端项ç®ï¼å¹¶ä¿®æ¹å端çæ¥å£å°å为æ¨çæå¡å¨å°åã
1. Clone project
git clone https://github.com/hai-27/vue-store.git
2. Project setup
cd vue-store
npm install
3. Compiles and hot-reloads for development
npm run serve
4. Compiles and minifies for production
npm run build
页é¢æªå¾
é¦é¡µ
å ¨é¨åå
è´ç©è½¦
æçæ¶è
æç订å
ç»å½
注å
ä½è hai-27
2020å¹´3æ8æ¥
Top Related Projects
🎉 A curated list of awesome things related to Vue.js
An exemplary real-world application built with Vue.js, Vuex, axios and different other technologies. This is a good example to discover Vue for beginners.
:tada: A magical vue admin https://panjiachen.github.io/vue-element-admin
Large single page application with 45 pages built on vue2 + vuex. 基于 vue2 + vuex 构建一个具有 45 个页面的大型单页面应用
A Vue.js 2.0 UI Toolkit for Web
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot