All Projects → Martian-in-Earth → dva-vue

Martian-in-Earth / dva-vue

Licence: MIT license
🌱 Vue and dva-core based

Programming Languages

javascript
184084 projects - #8 most used programming language
Vue
7211 projects
HTML
75241 projects

Projects that are alternatives of or similar to dva-vue

Dva
🌱 React and redux based, lightweight and elm-style framework. (Inspired by elm and choo)
Stars: ✭ 15,884 (+46617.65%)
Mutual labels:  redux-saga, dva
umi-dva-typescript-mock
基于umi + dva + typescript + mock + antd的react框架,内置PWA
Stars: ✭ 17 (-50%)
Mutual labels:  redux-saga, dva
Taro Dva
整合 taro-dvajs的仿知乎示例
Stars: ✭ 153 (+350%)
Mutual labels:  redux-saga, dva
booto
😍A light framework for React Application. Easy for life!
Stars: ✭ 18 (-47.06%)
Mutual labels:  redux-saga, dva
toutiao
模仿今日头条,实现 APP 端,Server 端, Web 管理端
Stars: ✭ 17 (-50%)
Mutual labels:  redux-saga, dva
next-react-boilerplate
🔥 NextJS with additional tech feature like react-boilerplate. Demo >>
Stars: ✭ 20 (-41.18%)
Mutual labels:  redux-saga
nextjs-redux-instagram
🌏 The simple Instagram was written by next.js & redux-saga & recompose
Stars: ✭ 48 (+41.18%)
Mutual labels:  redux-saga
react-native-dva-starter-with-builtin-router
Integrate dva into react-native app with builtin router of dva.
Stars: ✭ 17 (-50%)
Mutual labels:  dva
blog
✍️无他术,唯勤读书而多为之,自工。
Stars: ✭ 62 (+82.35%)
Mutual labels:  dva
tailmin
Tailmin - Admin dashboard built with Vue.js and Tailwind CSS
Stars: ✭ 39 (+14.71%)
Mutual labels:  vue-router
order-service
一个基于vuejs,reactjs,nodejs,socket.io的服务系统
Stars: ✭ 22 (-35.29%)
Mutual labels:  vue-router
react-native-basekit
Basic setup for react-native projects using react-native , redux, redux-sagas, react-navigation
Stars: ✭ 16 (-52.94%)
Mutual labels:  redux-saga
data-flow
frontend data flow explored in React
Stars: ✭ 19 (-44.12%)
Mutual labels:  redux-saga
use-routes
🚩 A router hook for not only react hooks API but also fre
Stars: ✭ 35 (+2.94%)
Mutual labels:  vue-router
hbb-survey-app
Hatay Municipality Survey Application
Stars: ✭ 18 (-47.06%)
Mutual labels:  redux-saga
cloud-music-mobile
This is a music player
Stars: ✭ 22 (-35.29%)
Mutual labels:  vue-router
laravel-react-boilerplate
Laravel React Boilerplate with Ant Design, Route-Level Code Splitting, Redux, Sanctum Auth
Stars: ✭ 49 (+44.12%)
Mutual labels:  redux-saga
vue-boilerplate
Vue boilerplate
Stars: ✭ 28 (-17.65%)
Mutual labels:  vue-router
vue-router-view-transition
Properly time out-in transitions with scrollBehavior
Stars: ✭ 38 (+11.76%)
Mutual labels:  vue-router
react-native-ecommerce
E-commerce mobile application developed using React Native 👔 🎩
Stars: ✭ 60 (+76.47%)
Mutual labels:  redux-saga

dva-vue

NPM version Build Status Coverage Status NPM downloads Dependencies js-standard-style MIT

NPM

Lightweight front-end framework based on dva-core and history
What's dva.js?

Demos & Plugins


Install

$ npm install --save dva-vue

Usage Example

<template>
    <div>
        <div>count: {{count}}</div>
        <div @click="add"></div>
    </div>
</template>
<script>
    import {connect} from 'dva-vue'
    export default connect(({count}) => ({count}))({
      methods: {
        add () {
          this.dispatch({type: 'count/add'})
        },
        asyncAdd () {
          this.dispatch({type: 'count/asyncAdd'}).then(()=>console.log('done'))
        }
      } 
    })
</script>
import dva, { createHashHistory } from 'dva-vue'
import App from 'App.vue'

const delay = ms => new Promise((resolve, reject) => setTimeout(() => resolve(), ms))

const app = dva({
  history: createHashHistory() // 默认值
})
app.model({
  namespace: 'count',
  state: 0,
  reducers: {
    add (state, { payload }) { return state + payload || 1 },
    minus (state, { payload }) { return state - payload || 1 }
  },
  effects: {
    * asyncAdd(_, {call, put}){
      // as some fetch action
      yield delay(1000)
      yield put({type: 'add', payload: 1})
    }
  }
})
app.router(() => [{ path: '/', component: App }])
app.start('#root')

API Reference

import dva, { 
    connect,
    dynamic
} from 'dva-vue'

LICENSE

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].