Giter Club home page Giter Club logo

vue-vuex-datalist's Introduction

โšก Vue Vuex Data

  • Vue app to display random fact data using Vuex state management.
  • Also shows a random image from Unsplash.
  • Note: to open web links in a new window use: ctrl+click on link

GitHub repo size GitHub pull requests GitHub Repo stars GitHub last commit

๐Ÿ“„ Table of contents

๐Ÿ“š General info

  • Data displayed using one-way data-binding and an v-for loop.
  • Simple top navigation between random fact shown on a card and a list of facts.
  • 'purgecss' was disabled to make this work with the version upgrades. It is not required anyway.

๐Ÿ“ท Screenshots

Example screenshot. Example screenshot.

๐Ÿ“ถ Technologies

๐Ÿ’พ Setup

  • Run npm i to install dependencies.
  • Run npm run serve then navigate to http://localhost:8080/. The app will automatically reload if you change any of the source files.
  • Run npm run build to create a build file

๐Ÿ’ป Code Examples

  • extract from store/index.js to control Vuex states
export default new Vuex.Store({
  state: {
    currentData: "Random facts display",
    allDatas: []
  },
  mutations: {
    setCurrentData(state, payload) {
      state.currentData = payload;
      state.allDatas.push(payload);
    }
  },
  actions: {
    async setCurrentData(state){
      const data = await fetch(url, { headers });
      const d = await data.json();
      console.log('json data: ', d.items)
      state.commit("setCurrentData", d.text);
    }
  },
  modules: {},
  getters: {
    getCurrentData: state => state.currentData,
    getAllDatas: state => state.allDatas
  }
});

๐Ÿ†’ Features

  • Uses Vue & Tailwind CSS for reduced bundle size
  • Random image every time app started or screen is refreshed, add API data model

๐Ÿ“‹ Status & To-Do List

  • Status: Working. Updated june 2021.
  • To-Do: Nothing

๐Ÿ‘ Inspiration

๐Ÿ“ License

  • This project is licensed under the terms of the MIT license.

โœ‰๏ธ Contact

vue-vuex-datalist's People

Contributors

andrewjbateman avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.