vue-sui-demo
用vue 和 SUI-Mobile 写了一个移动端demo,用来反馈学习vue的成果(禁用了SUI自带的路由,使用vue-router, vue-resource, webpack)[a web app written by vue & sui-mobile]
Top Related Projects
This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core
A Vue.js 2.0 UI Toolkit for Web
A high quality UI Toolkit built on Vue.js 2.0
🌈 An enterprise-class UI components based on Ant Design and Vue. 🐜
A lightweight, customizable Vue UI library for mobile web apps.
:tada: A magical vue admin https://panjiachen.github.io/vue-element-admin
Quick Overview
Vue-sui-demo is a demonstration project showcasing the integration of Vue.js with SUI Mobile, a lightweight mobile UI library. It provides a set of mobile-friendly components and layouts built with Vue.js, allowing developers to create responsive and visually appealing mobile web applications.
Pros
- Combines the power of Vue.js with the mobile-optimized UI components of SUI Mobile
- Offers a variety of pre-built components for rapid mobile app development
- Provides a responsive layout system for creating mobile-friendly interfaces
- Includes examples and documentation to help developers get started quickly
Cons
- The project appears to be outdated, with the last commit made several years ago
- May not be compatible with the latest versions of Vue.js or SUI Mobile
- Limited ongoing support or updates, which could lead to potential compatibility issues
- Lacks comprehensive documentation for all components and features
Code Examples
- Creating a simple button component:
<template>
<sui-button @click="handleClick">Click me</sui-button>
</template>
<script>
export default {
methods: {
handleClick() {
console.log('Button clicked!')
}
}
}
</script>
- Implementing a list view:
<template>
<sui-list>
<sui-list-item v-for="item in items" :key="item.id">
{{ item.name }}
</sui-list-item>
</sui-list>
</template>
<script>
export default {
data() {
return {
items: [
{ id: 1, name: 'Item 1' },
{ id: 2, name: 'Item 2' },
{ id: 3, name: 'Item 3' }
]
}
}
}
</script>
- Using a modal component:
<template>
<div>
<sui-button @click="showModal = true">Open Modal</sui-button>
<sui-modal v-model="showModal">
<h2>Modal Title</h2>
<p>Modal content goes here.</p>
<sui-button @click="showModal = false">Close</sui-button>
</sui-modal>
</div>
</template>
<script>
export default {
data() {
return {
showModal: false
}
}
}
</script>
Getting Started
To get started with vue-sui-demo:
-
Clone the repository:
git clone https://github.com/eteplus/vue-sui-demo.git
-
Install dependencies:
cd vue-sui-demo npm install
-
Run the development server:
npm run dev
-
Open your browser and navigate to
http://localhost:8080
to view the demo application.
Competitor Comparisons
This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core
Pros of Vue
- Much larger and more active community with over 200k stars on GitHub
- Comprehensive documentation and extensive ecosystem of plugins/tools
- Powers many large-scale production applications
Cons of Vue
- Steeper learning curve for beginners compared to simpler demos
- Potentially overkill for small projects or prototypes
- More complex build process and configuration
Code Comparison
vue-sui-demo:
<template>
<div id="app">
<h1>{{ msg }}</h1>
</div>
</template>
<script>
export default {
data () {
return {
msg: 'Hello Vue!'
}
}
}
</script>
Vue:
import { createApp } from 'vue'
const app = createApp({
data() {
return {
message: 'Hello Vue!'
}
}
})
app.mount('#app')
The vue-sui-demo example uses Vue 2 syntax with a single-file component, while the Vue example shows Vue 3 composition API setup. Vue offers more flexibility and advanced features, but may require more setup for simple use cases.
A Vue.js 2.0 UI Toolkit for Web
Pros of element
- Larger community and more active development (30k+ stars vs 260+ for vue-sui-demo)
- Comprehensive documentation and extensive component library
- Regular updates and maintenance
Cons of element
- Steeper learning curve due to more complex architecture
- Larger bundle size, which may impact performance for smaller projects
- Less flexibility for customization compared to vue-sui-demo's simpler structure
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">
<el-table-column prop="name" label="Name"></el-table-column>
<el-table-column prop="age" label="Age"></el-table-column>
</el-table>
vue-sui-demo:
<sui-button class="primary" @click="handleClick">Click me</sui-button>
<sui-input v-model="inputValue" placeholder="Enter text"></sui-input>
<sui-table :data="tableData">
<sui-table-column prop="name" label="Name"></sui-table-column>
<sui-table-column prop="age" label="Age"></sui-table-column>
</sui-table>
The code comparison shows that both libraries have similar component structures and usage patterns. However, element uses the "el-" prefix for its components, while vue-sui-demo uses "sui-". The syntax and attributes are largely similar, making it relatively easy for developers to switch between the two libraries if needed.
A high quality UI Toolkit built on Vue.js 2.0
Pros of iView
- More comprehensive UI component library with 40+ components
- Better documentation and examples
- Larger community and more active development
Cons of iView
- Steeper learning curve due to more complex components
- Potentially heavier bundle size if not using tree-shaking
Code Comparison
vue-sui-demo:
<template>
<sui-button>Click me</sui-button>
</template>
<script>
import { suiButton } from 'vue-sui'
export default {
components: { suiButton }
}
</script>
iView:
<template>
<Button type="primary">Click me</Button>
</template>
<script>
import { Button } from 'iview'
export default {
components: { Button }
}
</script>
Summary
iView offers a more robust and feature-rich UI library compared to vue-sui-demo. It provides a wider range of components and better documentation, making it suitable for larger projects. However, this comes at the cost of a steeper learning curve and potentially larger bundle size.
vue-sui-demo, on the other hand, is simpler and more lightweight, which could be advantageous for smaller projects or those requiring a minimal UI framework. The code comparison shows that both libraries have similar usage patterns, but iView's components are more customizable out-of-the-box.
🌈 An enterprise-class UI components based on Ant Design and Vue. 🐜
Pros of ant-design-vue
- More comprehensive UI component library with a wider range of components
- Better documentation and examples for developers
- Larger community and more frequent updates
Cons of ant-design-vue
- Heavier package size due to more components and features
- Steeper learning curve for beginners due to its complexity
Code Comparison
vue-sui-demo:
<template>
<sui-button>Click me</sui-button>
</template>
<script>
import { SuiButton } from 'sui-vue'
export default {
components: { SuiButton }
}
</script>
ant-design-vue:
<template>
<a-button>Click me</a-button>
</template>
<script>
import { Button } from 'ant-design-vue'
export default {
components: { 'a-button': Button }
}
</script>
Summary
ant-design-vue offers a more extensive component library with better documentation and community support, making it suitable for larger projects. However, it comes with a larger package size and a steeper learning curve. vue-sui-demo, on the other hand, is simpler and lighter, which may be preferable for smaller projects or beginners. The code comparison shows that both libraries have similar usage patterns, with slight differences in component naming conventions.
A lightweight, customizable Vue UI library for mobile web apps.
Pros of Vant
- Significantly more popular with 20.8k stars vs 1.1k for vue-sui-demo
- Actively maintained with frequent updates and releases
- Comprehensive documentation and extensive component library
Cons of Vant
- Larger bundle size due to more components and features
- Steeper learning curve for beginners compared to vue-sui-demo
- May require more configuration for custom styling
Code Comparison
vue-sui-demo:
<template>
<div class="page">
<header class="bar bar-nav">
<h1 class="title">SUI Mobile</h1>
</header>
<div class="content">
<!-- Content here -->
</div>
</div>
</template>
Vant:
<template>
<van-nav-bar title="Vant" />
<van-cell-group>
<van-cell title="Cell" value="Content" />
<van-cell title="Cell" value="Content" label="Description" />
</van-cell-group>
</template>
The code comparison shows that Vant uses more specific component tags, while vue-sui-demo relies on general HTML structure with classes. Vant's approach may lead to cleaner and more maintainable code, but vue-sui-demo's method might be more familiar to developers used to traditional HTML and CSS.
:tada: A magical vue admin https://panjiachen.github.io/vue-element-admin
Pros of vue-element-admin
- More comprehensive and feature-rich admin template
- Extensive documentation and community support
- Integrates with Element UI, a popular Vue.js component library
Cons of vue-element-admin
- Steeper learning curve due to its complexity
- Potentially overkill for smaller projects
- Heavier bundle size compared to vue-sui-demo
Code Comparison
vue-element-admin:
<template>
<div class="app-container">
<el-table :data="list" v-loading="listLoading" element-loading-text="Loading" border fit highlight-current-row>
<!-- Table columns -->
</el-table>
</div>
</template>
vue-sui-demo:
<template>
<div class="page">
<header class="bar bar-nav">
<h1 class="title">SUI Mobile</h1>
</header>
<nav class="bar bar-tab">
<!-- Navigation items -->
</nav>
</div>
</template>
The code comparison shows that vue-element-admin uses Element UI components like el-table
, while vue-sui-demo focuses on mobile-first design with SUI Mobile classes. vue-element-admin's code structure is more complex, reflecting its comprehensive nature, while vue-sui-demo's code is simpler and tailored for mobile applications.
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
vue-sui-demo
线ä¸è®¿é®å°å http://eteplus.github.io/vue-sui-demo
å¦æ对æ¨æ帮å©ï¼æ¨å¯ä»¥ç¹å³ä¸è§ "Star" æ¯æä¸ä¸ è°¢è°¢ï¼ ^_^
对äºé£äºåé®ä»¶ç»æçåå¦è¯´å£°æ±æ, ç±äºæ¬äººçé®ç®±å¿è®°å¯ç äºï¼æè¿ææ¾å, å¦æéå°ä»ä¹é®é¢çï¼æ¬¢è¿ä¸èµ·äº¤æµåå¦ä¹ ï¼ï¼2016-07-11ï¼
Vueå¾è½»éï¼æå®å¶ï¼æ¯è¾éå移å¨ç«¯ï¼å¾å欢Vueåç»ä»¶çæ¹å¼ï¼ ææç¨VUE å SUI-Mobile åäºä¸ä¸ªç§»å¨ç«¯demoï¼ç¨æ¥åé¦vueçå¦ä¹ ææï¼ç¦ç¨äºSUIèªå¸¦çè·¯ç±ï¼ä½¿ç¨Vue-routerï¼
ç¯å¢
- node v5.12.0
- cnpm 4.2.0
- npm 3.3.9
ææ¯æ
æªå¾
å®è£
项ç®å°åï¼ï¼ä½¿ç¨git clone
ï¼
git clone https://github.com/eteplus/vue-sui-demo.git
éè¿npm
å®è£
æ¬å°æå¡ç¬¬ä¸æ¹ä¾èµæ¨¡å(éè¦å·²å®è£
Node.js)ï¼ä½¿ç¨npmå®è£
ä¾èµæ¨¡åå¯è½ä¼å¾æ
¢ï¼å»ºè®®æ¢æcnpm
npm install -g cnpm --registry=http://registry.npm.taobao.org
# å®è£
ä¾èµæ¨¡å
cnpm install
# å¯å¨æå¡
npm run dev
# åå¸ä»£ç
npm run build
å¼å
ç®å½ç»æ
. âââ README.md âââ dist // 项ç®buildç®å½ âââ config // ç¯å¢åéåå ¥å£ï¼åºå£é ç½® âââ static // éæèµæºç®å½ âââ build // 项ç®çé ç½®æ件ç®å½ â âââ dev-server.js // å¼åçæå¡é ç½® â âââ webpack-dev-conf.js // å¼åçWebpack é ç½®æ件 â âââ webpack-prod-conf.js // ç产çWebpack é ç½®æ件 â âââ webpack-base-conf.js // åºæ¬çWebpack é ç½®æ件 âââ package.json // 项ç®é ç½®æ件 âââ src // ç产ç®å½ â âââ assets // css js åå¾çèµæº â âââ data // æ°æ®æ件 â âââ components // åç§ç»ä»¶ â âââ views // åç§é¡µé¢ â âââ directives // åç§æ令 â âââ filters.js // åç§è¿æ»¤å¨ â âââ router.js // è·¯ç±é ç½® â âââ main.vue // æ ¹ç»ä»¶ â âââ app.js // Webpack é¢ç¼è¯å ¥å£ âââ index.html // 项ç®å ¥å£æ件 .
æ´æ°è®°å½
åç CHANGELOG.md
Top Related Projects
This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core
A Vue.js 2.0 UI Toolkit for Web
A high quality UI Toolkit built on Vue.js 2.0
🌈 An enterprise-class UI components based on Ant Design and Vue. 🐜
A lightweight, customizable Vue UI library for mobile web apps.
:tada: A magical vue admin https://panjiachen.github.io/vue-element-admin
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